What you need to do is configure Fiddler to work as a "reverse proxy"
There are instructions on 2 different ways you can do this on Fiddler's website. Here is a copy of the steps:
Step #0
Before either of the following options will work, you must enable other computers to connect to Fiddler. To do so, click Tools > Fiddler Options > Connections and tick the "Allow remote computers to connect" checkbox. Then close Fiddler.
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:
- Start REGEDIT
- Create a new DWORD named ReverseProxyForPort inside HKCUSOFTWAREMicrosoftFiddler2.
- Set the DWORD to the local port you'd like to re-route inbound traffic to (generally port 80 for a standard HTTP server)
- Restart Fiddler
- 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 device for which you cannot configure the web proxy. You want to capture the traffic from the phone and the server's response.
- Start Fiddler on the WEBSERVER machine, running on the default port of 8888.
- Click Tools | Fiddler Options, and ensure the "Allow remote clients to connect" checkbox is checked. Restart if needed.
- Choose Rules | Customize Rules.
- Inside the OnBeforeRequest handler, add a new line of code:
if (oSession.host.toLowerCase() == "webserver:8888") oSession.host = "webserver:80";
- 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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…