Using Fiddler with node.js on Microsoft Windows

The node.js request module supports proxies. There are a couple of different ways to enable this. I find this approach nifty as it doesn’t involve changes to the app or the app’s config.

Open a Windows command prompt and type the following commands.
set https_proxy=http://127.0.0.1:8888
set http_proxy=http://127.0.0.1:8888
set NODE_TLS_REJECT_UNAUTHORIZED=0

Now if you execute your node.js application from within this command shell while Fiddler is running, you will be able to sniff the the traffic that your app is initiating.

When you are done, you can simple close the command shell session or type the following to reset the proxy settings.
set https_proxy=
set http_proxy=
set NODE_TLS_REJECT_UNAUTHORIZED=

Advertisements
This entry was posted in node.js, recipes. Bookmark the permalink.

One Response to Using Fiddler with node.js on Microsoft Windows

  1. ANkit says:

    Awesome !! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s