Video icon
Video Tutorials
Search this site
Get Fiddler! Addons Help & Documentation Developer Info Discuss Contact

Using Fiddler as a Reverse Proxy

Introduction

Sometimes, you may want to use Fiddler to trap traffic but for some reason you cannot configure the client to use a proxy server. 

Fiddler can operate as a "reverse proxy" which means that it can forward inbound requests to a different port or web server.

Option #1: Configure Fiddler as a Reverse-Proxy

Fiddler can be configured so that any traffic sent to http://127.0.0.1:8888 is automatically sent to a different port on the same machine.  To set this configuration:

  1. Start REGEDIT
  2. Create a new DWORD named ReverseProxyForPort inside HKCU\SOFTWARE\Microsoft\Fiddler.
  3. Set the DWORD to the local port you'd like to re-route inbound traffic to (generally port 80 for a standard HTTP server)
  4. Restart Fiddler
  5. Navigate your browser to http://127.0.0.1:8888

Option #2: Write a FiddlerScript rule

Alternatively, you can write a rule that does the same thing. 

Say you're running a website on port 80 of a machine named WEBSERVER.  You're connecting to the website using Internet Explorer Mobile Edition on a Windows SmartPhone telephone device for which you cannot configure the web proxy.  You want to capture the traffic from the phone and the server's response.

  1. Start Fiddler on the WEBSERVER machine, running on the default port of 8888.
  2. Click Tools | Fiddler Options, and ensure the "Allow remote clients to connect" checkbox is checked.  Restart if needed.
  3. Choose Rules | Customize Rules.
  4. Inside the OnBeforeRequest handler, add a new line of code:
    if (oSession.host.toLowerCase() == "webserver:8888") oSession.host = "webserver:80";
  5. On the SmartPhone, navigate to http://webserver:8888

Requests from the SmartPhone will appear in Fiddler.  The requests are forwarded from port 8888 to port 80 where the webserver is running.  The responses are sent back through Fiddler to the SmartPhone, which has no idea that the content originally came from port 80.


< Back to Help Homepage



©2008 Microsoft Corporation