Loren Halvorson's Blog

If your only tool is a hammer...

Tip for using Fiddler on localhost

When I'm troubleshooting HTTP traffic, I reach for the invaluable Fiddler trace utility. It shows me everything going on over HTTP.

However, when you run Fiddler against a localhost URL you probably won't see any traffic, but you can easily fix this by simply adding a dot to the end of localhost in the address.

Intead of http://localhost:1234/MyApp/...,
use http://localhost.:1234/MyApp/... (it's subtle, but notice the extra dot after localhost).

This tip is widely known and documented (there are other workarounds listed at that link), but I just wanted to highlight this simple fix, because I've recently seen some who were not aware of it. It would be very unfortunate for someone to download and try Fiddler only to immediately discount it as "junk" just because of this. It is an awesome tool, and it's not just for IE, it hooks WinINET and is useful for watching other HTTP traffic like web service calls.

Comments

PBZ said:

You can also use your computer's name instead of localhost

# January 10, 2008 1:29 PM

LarryB said:

I made this suggestion during a MSDN event when the presenter was having troubles and he looked at me like I was nuts.

# January 10, 2008 2:58 PM

Dmitriy Nagirnyak said:

Thanks. You saved my day.

# January 10, 2008 5:35 PM

links for 2008-01-10 « dstelow notes… said:

Pingback from  links for 2008-01-10 « dstelow notes…

# January 10, 2008 6:41 PM

Tip for using Fiddler on localhost said:

Pingback from  Tip for using Fiddler on localhost

# January 15, 2008 1:38 PM

Using Fiddler on Localhost « Philippe graca’s Weblog said:

Pingback from  Using Fiddler on Localhost « Philippe graca’s Weblog

# January 22, 2008 5:48 AM

Ryan said:

How do you setup Fiddler to run server side?  (Where client is not running local?)  

Is it possible to monitor a WebService this way?

# January 25, 2008 6:34 AM

Ryan said:

Never mind... MSSoapT3 is the one for server side.

Great blog!

# January 25, 2008 7:02 AM

olja said:

Is this supposed to work with Vista & Fiddler 2.1.2. I have tried adding the dot as well as using the computer name via host files without luck. Is there anything else that I can try?

Thanks for the post!

Olja

# March 13, 2008 4:21 PM

lorenh said:

Good question. I currently don't have any Vista machines at my disposal to try.  I've only tried it with Fiddler version 2.1.1.1 (and I just tried 2.1.4.4) on Windows XP, and all is good. Somone out there using Fiddler on Vista will need to comment.

# March 13, 2008 4:42 PM

Davide said:

I'm using Fiddler 2.1.6.2 on a Vista SP1 x64 machine (Italian locale).

The dot workaround does not work (gives a HTTP 400 error).

The http://machinename:port syntax, instead, works perfectly.

# May 15, 2008 6:19 AM

Gabi D said:

great tip :))

# October 14, 2008 3:57 AM

Johnson Mathew said:

Can anyone explain me what is happening if we put extra dot after localhost?

# October 16, 2008 2:26 AM

wormster said:

Try using http://ipv4.fiddler:1234/MyApp...

Can't remember where I got this from but it works on Vista for Fiddler v2.1.8.2

# November 7, 2008 9:58 AM

Annihil8 said:

wormsters idea works indeed :)

# December 10, 2008 7:24 AM

Josh said:

(For Matthew Johnson):

It has something to do with the trailing dot indicating a FQDN (fully qualified domain name).

# February 2, 2009 1:56 PM

B2B said:

solution with dot will not work when site is using windows auth. the tip with pc name is better

# February 10, 2009 4:32 PM

Will said:

For people hunting for a vista solution. The localhost. doesn't appear to work, and if you're debugging visual studio hosted web applications it's fiddly to use the machine name. However there's no place like 127.0.0.1.

so http://127.0.0.1.:port/  does appear to show up on fiddler even in vista (i.e. put a "." after the loop back ip address)

# April 2, 2009 4:47 AM

Michel said:

Great!

almost happend to me too, calling it  'not usable'

On my machine: windows vista, ASP.Net, visual studio 2008 running the VS internal webserver, the http://127.0.0.1.:port/ solution worked like a charm.

# April 24, 2009 9:33 AM

rmdw said:

A big THANKS to wormster for his suggestion to use this syntax:

 http://ipv4.fiddler:1234/MyApp...

I'm running VS2008 on a 64-bit Vista machine and it's the only that worked to get Fiddler monitoring my app when running locally.

# April 27, 2009 6:08 PM

Nemesis116 said:

Thanks!

# July 20, 2009 4:49 AM

ak said:

very useful tip. thanks.

# August 4, 2009 10:03 PM

Cosmin said:

Very good tip, Wormster. It helped me a lot!

# October 11, 2009 7:46 PM

George Barker said:

Ugh.  Not working for me.  Is anyone using ASP.NET MVC?  I think changing the root is screwing up my routing...

# October 14, 2009 3:59 PM

George Barker said:

Actually routing is working fine.  I think the problem was I had authenticated automatically as the app started up under the "localhost" domain and that didn't carry over to the 127.0.0.1. domain.  If I authenticate at 127.0.0.1. all is well and fiddler works.

# October 14, 2009 4:08 PM

Lasse Sjørup said:

I had this problem too and found that Fiddlers urlreplace did the job rather well. I lacked a few things so I’ve created the “fiddler bulk urlreplace” plugin fiddlerurlreplace.codeplex.com. This will allow you to browse your localhost as if it was your live server transparent to the browser, It will allow you to access cookies normally only visible on the server and it supports replacing only subparts of the site.

# December 4, 2009 9:47 AM

Deepak said:

i wud like to know how can i tace the ip of a person while chating on gmail

# January 8, 2010 12:52 AM

fkerim said:

Very useful blog. Thanks

# January 13, 2010 4:14 AM

Sreenath Urala said:

And i was publishing my asp.net site to IIS to debug the Web Service calls each time i built. And a single '.' would save me so much trouble?

Saved by the '."

Thanks

Sreenath

# January 19, 2010 11:54 AM

Hashmat said:

How to get the traffic when we click something in a pop up window (localhost application) which does not show any url. How to put the dot (.) after localhost.

or what could be the work around for it

Thanks

Hashmat

# February 19, 2010 7:51 AM

gratefulReader said:

Anybody that suggests using the machine name instead, obviously has never worked in a team environment where the same project may be worked on by many people on many different machines.  Development using explicit machine names is painful.

# February 21, 2010 3:46 PM

TZ said:

I tried this option in Windows 2008 Server x64 but didn't work. Please let me know whether I should do something different for Win2K8 server. THANKS.

# March 23, 2010 9:22 PM

Turibbio's Blog said:

NeL seguente link potete trovare una serie di metodi per poter usare Fiddler2 in localhost, quando in

# June 9, 2010 7:43 AM

Kyle McClellan said:

John and I went through four questions we see frequently on the WCF RIA Services forum . Here’s our episode

# November 12, 2010 6:42 PM

RIA Services said:

John and I went through four questions we see frequently on the WCF RIA Services forum . Here’s our episode

# November 12, 2010 7:09 PM