Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localhost packet analyzer for Mac

Packet sniffers generally do not capture localhost traffic. I need to inspect some post data in a localhost environment (being generated from a Ruby on Rails development). Do you know of any programs that expose localhost packets?

like image 684
kingjeffrey Avatar asked Apr 21 '10 16:04

kingjeffrey


People also ask

Can Wireshark capture localhost?

Wireshark cannot sniff traffic within the same machine (localhost) on Windows. If you need to sniff local traffic on Windows, try Fiddler.

Can Wireshark capture all network traffic?

By default, Wireshark only captures packets going to and from the computer where it runs. By checking the box to run Wireshark in promiscuous mode in the capture settings, you can capture most of the traffic on the LAN.


2 Answers

I use fiddler on my Windows box for http sniffing. Since its only looking at http traffic you don't get nearly the amount of noise you get with something like WireShark.

The trick to getting it to work with data sent and received locally is to use a different endpoint for your urls. Using http://127.0.0.1./YourServiceName instead of http://localhost/YourServiceName has always worked for me. Its important to include the trailing 'dot' in the IP address. Don't ask me why though.

like image 50
matheeeny Avatar answered Sep 21 '22 05:09

matheeeny


If you use Firefox, you could use the HTTP Logging feature:

https://developer.mozilla.org/en/HTTP_Logging

like image 22
ghoppe Avatar answered Sep 21 '22 05:09

ghoppe