小智 5
谢谢克里斯,在我的例子中,我使用的是查尔斯和请求模块。有一个处理代理选项来放置您的查尔斯端口。
所以要在Charles菜单Proxy->Proxy Settings->Http Proxy中找到你的端口
在任何请求中使用此端口号,例如:
request.get(url, {
'proxy': 'http://localhost:<charles-proxy-port>'
}, function (error, response, body) {
//did you see me in Charles??
});
Run Code Online (Sandbox Code Playgroud)
弄清楚了。我按照How can I use an http proxy with node.js http.Client? 中的说明进行操作 我认为我需要使用 https 来访问代理。但是如果我使用 http 访问代理,并传递例如“路径:” https://www.google.com/accounts/OAuthGetRequestToken ',那么它就可以工作......
| 归档时间: |
|
| 查看次数: |
5523 次 |
| 最近记录: |