在使用request模块的时候
var targetOptions = {
method: 'GET',
url: 'http://url',
timeout: 8000,
encoding: null,
};
targetOptions.proxy = 'http://213.183.252.156:8081'; //代理服务器
request(targetOptions, function (error, req,body) {
})
可以使用代理进行HTTP请求
在HTTP模块中 http.get
是否也可以达到如上的效果?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
光阴似箭催人老,日月如移越少年。