A long time ago, I wrote a little (hacky) perl script to help me diagnose the HTTP flowing between a web client and the server.
It was handy to see the raw negotiation and flows, as well as debug cookies and the like, and also demonstrated the correct way to handle reading and writing multiple sockets without blocking using a single thread (as opposed to lots of blocking threads).
It was written to act as fake server (and would send all requests thru to a "real target") but later versions could also act as a proper proxy, but most people found this more of a hassle to setup and configure.
The days I'd recommend people use something like HttpWatch - yeah it'll cost you a few dollars but it'll do all sorts of things.. but for anyone perverse enough (or too tight to cough up), I'll post the code here again when I find it...
It was handy to see the raw negotiation and flows, as well as debug cookies and the like, and also demonstrated the correct way to handle reading and writing multiple sockets without blocking using a single thread (as opposed to lots of blocking threads).
It was written to act as fake server (and would send all requests thru to a "real target") but later versions could also act as a proper proxy, but most people found this more of a hassle to setup and configure.
The days I'd recommend people use something like HttpWatch - yeah it'll cost you a few dollars but it'll do all sorts of things.. but for anyone perverse enough (or too tight to cough up), I'll post the code here again when I find it...