Sniffing localhost network traffic

I've coded my sniffer using raw sockets and promiscuous mode, it works fine, sniffing all incoming and outoging traffic. However, I want it to be able to capture packets from my local loopback address 127.0.0.1 as well, because I have both client and server applications running on my local machine and I want to see the traffic between them.

It is mentioned here that raw sockets can be used - http://wiki.wireshark.org/CaptureSetup/Loopback. There is even a tool mentioned - RawCap that can do what I need.

So basicly I want to add that feature that RawCap has into my own sniffer. How do I configure my raw socket to capture local loopback traffic? All I can really find are tools to intercept this kind of traffic, but nothing that says how to do it yourself
Last edited on
Topic archived. No new replies allowed.