i'm trying to capture node.js http traffic with a protocol analyser (Charles) but can't get node to use the proxy. Is there some way to get nodes http and https modules to use a proxy?
I'm using OSX by the way
Thanks Chris in my case I was using Charles and Request module. There is a handle proxy option to put your charles port.
So to find your port in the Charles menu Proxy->Proxy Settings->Http Proxy
Use this port number in any request eg:
request.get(url, {
'proxy': 'http://localhost:<charles-proxy-port>'
}, function (error, response, body) {
//did you see me in Charles??
});
Figured it out. I was following the instructions from How can I use an http proxy with node.js http.Client? And i thought i needed to use https to access the proxy. But if i use http to access the proxy, and pass eg 'path: 'https://www.google.com/accounts/OAuthGetRequestToken', then it works...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With