2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const request = require('request');
var Agent = require('socks5-https-client/lib/Agent');
request({
url: 'https://google.com/',
strictSSL: true,
agentClass: Agent,
agentOptions: {
socksHost: 'localhost', // Defaults to 'localhost'.
socksPort: 1086, // Defaults to 1080.
}
}, function(err, res) {
console.log(err || res.body);
});
参考资料;
SOCKS5 HTTPS Client
Add Socks Proxy support
本文链接: https://dreamerjonson.com/2018/11/16/node-http-socket5/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY 4.0 CN协议 许可协议。转载请注明出处!
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。