Search code examples
delphidelphi-7

how do I Sniff/Listen HTTP on my local machine?


I would like to Sniff/Listen on port 80 requests/responses.

Can it be done with TIdHTTPServer? If so, then how?

Edit: I want my application to listen on browser activity (it can be IE, Chrome, FF etc...) and get all the media links (images, movies). something like MediaPluck

The "problem" with MediaPluck is that you need to alters the proxy server in your web browser configuration, and I think it's a bad idea.


Solution

  • There is no way to use TIdHTTPServer or TIdHTTPProxyServer to sniff HTTP traffic without altering browser/client settings to connect to it. That is what Fiddler does - alters WinInet's proxy settings temporarily (IE uses WinInet, so it picks up the alterations transparently). What you are asking for requires lower-level sniffing of the network subsystem, such as what WinPCap/Ethereal does.