116

I want to monitor HTTP traffic between a process on my local machine and another (server) process, also running on my local machine.

How can I configure Fiddler to listen to traffic to and from localhost?

Frode Evensen
  • 516
  • 1
  • 10
  • 22
The Light
  • 26,341
  • 62
  • 176
  • 258
  • possible duplicate of [How do I get Fiddler to stop ignoring traffic to localhost?](http://stackoverflow.com/questions/214308/how-do-i-get-fiddler-to-stop-ignoring-traffic-to-localhost) –  Jun 26 '14 at 14:09

16 Answers16

151

By simply adding fiddler to the url

http://localhost.fiddler:8081/

Traffic is routed through fiddler and therefore being displayed on fiddler.

Tomer
  • 4,382
  • 5
  • 38
  • 48
  • 1
    Works in .net without having to set proxy in the HttpClientHandler! – Telemat Feb 18 '15 at 07:47
  • 1
    This method works will with Visual Studio's test webserver according to Telerik's documentation: http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/MonitorLocalTraffic – ksaylor11 Aug 24 '15 at 20:28
  • Even this is overkill. All you have to do is use the computer's IP address instead of localhost. – Christian Findlay Nov 14 '18 at 22:40
62

Add a dot . after the localhost.

For example if you had http://localhost:24448/HomePage.aspx

Change it to http://localhost.:24448/HomePage.aspx

Internet Explorer is bypassing the proxy server for "localhost". With the dot, the "localhost" check in the domain name fails.

Oleg Grishko
  • 4,132
  • 2
  • 38
  • 52
  • 7
    Technically it's not Internet Explorer bypassing the proxy, it is DNS itself. `localhost` in DNS always resolves without using a proxy. More info on [wikipedia](http://en.wikipedia.org/wiki/.localhost) – Liam Oct 18 '13 at 14:44
  • 1
    As a side tip, if you want to also capture traffic to web services within .net, set the web service proxy to 127.0.0.1:8888 before calling the ws. – n00b Jun 09 '14 at 22:02
21

.NET and Internet Explorer don't send requests for localhost through any proxies, so they don't come up on Fiddler.

Many alternatives are available

Use your machine name instead of localhost. Using Firefox (with the fiddler add-on installed) to make the request. Use http://ipv4.fiddler instead of localhost.

For more info http://www.fiddler2.com/Fiddler/help/hookup.asp

AJ.
  • 13,461
  • 19
  • 51
  • 63
jatin
  • 1,379
  • 8
  • 7
  • 1
    I believe with IE 9 RC, Fiddler can now capture the localhost requests – SteveC Feb 25 '11 at 10:25
  • I push the URL changed for the [help](http://docs.telerik.com/fiddler/observe-traffic/troubleshooting/notraffictolocalhost) see above – general03 May 11 '15 at 13:15
9

try putting your machine name/IP address instead of 'localhost' into URL. Works for me...

myro
  • 1,158
  • 2
  • 25
  • 44
6

Rather than configure the application server and client to use another domain, you may want to configure the client application to use a proxy. Fiddler also creates a proxy you can use, logging all traffic. Rick Strahl blogged about using this in .NET Apps, I am always misplacing this blog post, so let me link it here: http://weblog.west-wind.com/posts/2008/Mar/14/Debugging-Http-or-Web-Services-Calls-from-ASPNET-with-Fiddler.

To be brief, the app.config change is:

<system.net>
  <defaultProxy>
    <proxy  proxyaddress="http://127.0.0.1:8888" />      
  </defaultProxy>
</system.net>
Frank Schwieterman
  • 24,142
  • 15
  • 92
  • 130
4

You cannot. Instead if you machine is named "myMachine", point your browser to http://mymachine instead of http://localhost

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • tried even that but can't listen to it when url rewriting is enabled, however when url redirecting is enabled it shows it. – The Light Jan 10 '11 at 13:33
2

tools => fiddler options => connections there is a textarea with stuff to jump, delete LH from there

bresleveloper
  • 5,940
  • 3
  • 33
  • 47
2

Replace localhost by lvh.me in your URL

For example if you had http://localhost:24448/HomePage.aspx

Change it to http://lvh.me:24448/HomePage.aspx

Hossein
  • 390
  • 7
  • 14
2

And I just found out that on vista 'localhost.' will not work. In this case use '127.0.0.1.' (loopback address with a dot appended to it).

Michal B.
  • 5,676
  • 6
  • 42
  • 70
1

Replace localhost with 127.0.0.1 If it doesn't work change the run configuration to support your ip address.

0

I am running Fiddler v4.4.7.1. I needed to use localhost:8888 or machinename:8888 when using the Composer tab. Look at the Help/About Fiddler menu option, where it says, "Running on:". Mine shows machinename:8888 there.

pollifax
  • 51
  • 3
0

The Light,

You can configure the process acting as the client to use fiddler as a proxy.

Fiddler sets itself up as a proxy conveniently on 127.0.0.1:8888, and by default overrides the system settings under Internet Options in the Control Panel (if you've configured any) such that all traffic from the common protocols (http, https, and ftp) goes to 127.0.0.1:8888 before leaving your machine.

Now these protocols are often from common processes such as browsers, and so are easily picked up by fiddler. However, in your case, the process initiating the requests is probably not a browser, but one for a programming language like php.exe, or java.exe, or whatever language you are using.

If, say, you're using php, you can leverage curl. Ensure that the curl module is enabled, and then right before your code that invokes the request, include:

curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

Hope this helps. You can also always lookup stuff like so from the fiddler documentation for a basis for you to build upon e.g. http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigurePHPcURL

0

If you're using FireFox, Fiddler's add-on will automatically configure it to not ignore localhost when capturing traffic. If traffic from localhost is still (or suddenly) not appearing, try disabling and re-enabling traffic capture from Fiddler to goad the add-on into fixing the proxy configuration.

Suncat2000
  • 966
  • 1
  • 12
  • 15
0

This is easy. Just grab your computer's IP address with IPconfig at the command prompt. Then, hit the service using the IP address rather than localhost. You don't need to do anything to Fiddler to make this work, it will just work by itself.

Christian Findlay
  • 6,770
  • 5
  • 51
  • 103
0

Specific to Firefox, which does not go through Internet Options like IE, Chrome, and Edge do, you can use about:config to modify preferences, find the preference network.proxy.no_proxies_on and remove localhost from it.

This was the default setting for Firefox Developer Edition 66.0b2 and worked with Fiddler 5.0.20182.28034.

(Other listed solutions do work, this solution allows you to not change the host you are navigating to.)

mlhDev
  • 2,235
  • 1
  • 22
  • 43
0

Go to proxy settings in Firefox and choose "Use system proxy" but be sure to check if there is no exception for localhost in "no proxy for" field.

enter image description here enter image description here

Mariusz Pawelski
  • 25,983
  • 11
  • 67
  • 80