Capture network traffic in NodeJS with Fiddler1 min read

Estimated Reading Time: 1 minute

I recently worked again on my VSTS Office Outlook Release / Build Tasks.

As they are written in NODE, I’m using the SOAP package from NPM to make requests to the EXCHANGE / Office 365 SOAP service.

Unfortunately the requests FAILED for a weird reason, and I could not figure out why..

So I wanted to leverage FIDDLER –  an HTTP network traffic sniffer similar to Wireshark or Postman, to intercept the HTTP traffic and find out whether what was being sent around was correct.

BUT.. how to use Fiddler with NODE JS?

Here’s the trick:

Open command prompt (on Windows) and set these environment variables.

set https_proxy=http://127.0.0.1:8888
set http_proxy=http://127.0.0.1:8888
set NODE_TLS_REJECT_UNAUTHORIZED=0

Open FIDDLER and make sure Tools –> Options –> Capture HTTPS CONNECTs and Decrypt HTTPS traffic  are turned ON, if you plan to intercept HTTPS traffic.

Done! Your NODE http/https Traffic will now show up in Fiddler!

image

Leave a Reply

Your email address will not be published. Required fields are marked *