This weekend I wrote another program that will serve as a training aid for classes I'm giving. Download www-teach.zip.
I thought of this long ago and never got around to actually writing it. The idea is to demonstrate what the browser is sending to the webserver in a side-by-side view. The program, written in Microsoft Visual C# 2008 Express Edition as usual, internally creates a webserver. It uses the webbrowser class to allow the student to see what's going on. The cool part is that it also shows the HTTP/1.1 GET Request as it comes through the wire.
|Here the application runs happily in Windows while logged in as an Administrator.||To my pleasant surprise, the program also runs in Linux if you have Monodevelop installed. The raw socket forced me to as root (so extract the ZIP, install Monodevelop, then type "sudo mono www-teach.exe").|
This code is intended for educational use only...if you want to watch the GET requests coming down the wire on your production webserver, I recommend you try Wireshark or just parse your logfile.
Many thanks to the author of SocketProgramming.BlogSpot.com. Your example code was very helpful in creating this program.
If you're a Mac user, please test (Mono should run on Mac OSX). If it works, please tell me how you made it work and send a screenshot.