Trying to capture node.js http traffic using protocol analyzer (Charles) but cannot get node to use proxy

I am trying to capture node.js http traffic using a protocol analyzer (Charles) but cannot use node to use a proxy server. Is there a way to get http nodes and https modules to use a proxy server?

I am using OSX by the way

+6
source share
2 answers

Thanks Chris in my case, I used Charles and Request . There is a proxy option handle to put your charles port.

So, to find your port in the Charles Proxy menu-> Proxy Settings-> Http Proxy

Use this port number in any request, for example:

request.get(url, { 'proxy': 'http://localhost:<charles-proxy-port>' }, function (error, response, body) { //did you see me in Charles?? }); 
+4
source

Figured it out. I followed the instructions. How to use 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, for example, 'path:' https://www.google.com/accounts/OAuthGetRequestToken ', then it works ...

+2
source

Source: https://habr.com/ru/post/890647/


All Articles