Windows – How to capture traffic to localhost using Wireshark

capturelocalhostwindows-vistawireshark

I am using Wireshark on Windows Vista and I would like to capture http traffic to localhost (127.0.0.1), for debugging purposes, but I have some questions.

  • How can I do this?
  • What capture interface should I use?
    • If I use my NIC as capture interface, only packets to and from the internet are captured.
  • Are there any settings in Wireshark to capture packets going to and from localhost?

Best Answer

The short answer is, on Windows you can't. The Wireshark Wiki describes a couple of workarounds, such as installing a virtual network card using the Microsoft Loopback Adapter, however the results are less than optimal. Their suggestion of setting up a new route will give you all of your data twice, and could put unnecessary load on your network if left enabled, but you should get the data.