Node.js with express - fiddler not capturing some requests

3,010 views
Skip to first unread message

dam...@incroud.com

unread,
Jun 3, 2014, 7:06:57 PM6/3/14
to httpf...@googlegroups.com

 

I’m running windows 8.1 with node.js, and express.js on top of it.

 Fiddler captures all the traffic from browser > nodejs, but when nodejs makes an external call to another server it will not show up in fiddler. 

 I’ve tried the httpsys module for node (which produces errors, presumably because of express.js?), I’ve tried many other things including configuring winhttp proxy with netsh.  Nothing works.

 Any help is appreciated.

EricLaw

unread,
Jun 4, 2014, 5:31:14 PM6/4/14
to httpf...@googlegroups.com
Node doesn't automatically use the system's proxy settings. You need to set the proxy directly using whatever options the object provides. See e.g. http://stackoverflow.com/questions/8697344/can-a-proxy-like-fiddler-be-used-with-node-jss-clientrequest

dam...@incroud.com

unread,
Jun 4, 2014, 6:10:48 PM6/4/14
to httpf...@googlegroups.com

Unfortunately, that doesn’t work at all. I’ve tried everything including the link you provided, proxifiers, the nodejs tunnel module, the httpsys module, and everything else found in thousands of google results. None of it is working.

I’m a very long-time fiddler user, at least 10 years - I have an entire LCD monitor dedicated to fiddler. Fiddler is that important to me. I’m starting a new project with nodejs and it is proving incredibly troublesome getting nodejs working with fiddler. It’s turning into a nightmare.

Is anyone else out there able to view https server-to-server requests from nodjs in fiddler?

EricLaw

unread,
Jun 5, 2014, 10:03:58 AM6/5/14
to httpf...@googlegroups.com
Please share the JS code that you're using.

John Deighan

unread,
Jul 13, 2017, 4:04:25 AM7/13/17
to Fiddler
I can capture http traffic using fiddler in a node.js script that uses the request library (i.e. npm install request) by adding these lines to the top of my script:

process.env.https_proxy = "http://127.0.0.1:8888";
process.env.http_proxy = "http://127.0.0.1:8888";
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

Unfortunately, I haven't yet figured out how to determine whether fiddler is, in fact, running, so putting these lines and running my script when fiddler is not running results in errors. I'm not sure if it matters, but the URL I'm using uses my machine name and not 'localhost'. Though I just tested it using 'localhost' and fiddler captured the traffic. I still mention it because I had a previous instance where fiddler could not capture traffic to 'localhost', but using my machine name worked.

EricLaw

unread,
Jul 13, 2017, 9:14:28 AM7/13/17
to Fiddler
Fiddler has no problem capturing traffic to localhost, but some platforms (most notably, .NET) bypass the proxy for localhost requests.

There are a number of ways in which you could detect Fiddler from node.js; the simplest would be to just hit 127.0.0.1:8888/echo.aspx and see if you get anything back. Alternatively, if node.js has modules to read the registry or task list, you could use those.
Reply all
Reply to author
Forward
0 new messages