views:

1969

answers:

4

I am looking for a sniffer that can work with the loopback address in Windows.

So far, I found Microsoft Network Monitor which is a nice tool, but for localhost it's useless because on Windows, localhost packets don't pass through the regular network stack, so they're invisible to an ethernet sniffer like MS Network Monitor.

How do you debug applications that send data in the loopback mechanism? Any good (open source) sniffers that can work with localhost?

UPDATE: If you have experience with a tool, it would be nice to have a short description for future reference

Thanks.

+3  A: 

I would recommend Wireshark, it can attach to any network device and offers some nice utilities to analize the traffic, plus it is free software.

psychoschlumpf
plus wireshark is available for Windows, Mac OSX (Intel and PPC) and Linux -- we use it all the time (well, monthly at least).
OldTroll
I found a interesting remark on http://wiki.wireshark.org/CaptureSetup/Loopback: "You can add a virtual network card called Microsoft Loopback Adapter, but in most cases that might not give results as expected either.". So, this means it has some drawbacks. Anyway, it looks promising.
cmdev
I can't see a thing with Wireshark when it comes to localhost.
mackenir
+4  A: 

I believe you can do http://localhost./ (note the period at the end) to force localhost packets through the regular network stack.

This works for getting http to be recognized by a tool like fiddler - not sure about other protocols.

Michael Gattuso
With Fiddler, you can also simply use http://ipv4.fiddlerOf course, the OP didn't mention if he wants to see HTTP(S) traffic.
EricLaw -MSFT-
I didn't know that, thanks for the info Eric. It looks like this only works when fiddler is running though, correct?
Michael Gattuso
Yes, "ipv4.fiddler" is implemented by Fiddler, so it only resolves when Fiddler is running.
EricLaw -MSFT-
+1  A: 

A quick google seach came back with this result for CaptureSetup/Loopback

Kirschstein
does not work in windows.
leonbloy
+9  A: 

I was faced with this issue and got nowhere after a lot of research. Basically all available sniffers rely on the network driver stack, and Windows don't expose localhost calls through it. What I ended up using was a tool called SocketSniffer, that peeks at Winsock's calls and monitor TCP, UDP socket connections. It helped me debug an application problem that only occurred in win 2k3. Its download site is at http://socketsniff.nirsoft-freeware.qarchive.org/_download2.html

nobre
Yes, now I see my localhost packets. Thank you for the sniffer tool. I will added it to my debugging "toolbox".
cmdev
+1 Really useful
leonbloy