Monitoring HTTP Traffic

The following appendix describes a convenient way to monitor the real HTTP communication between a client and a server in a human readable format. It is given only for educational purposes. The main tool used is tcpwatch which is written in Python and can serve as an HTTP proxy. After it is installed for the corresponding operating system, it is started as a proxy with either of the following commands:

# tcpwatch.py -h -p :3128
# tcpwatch.py -s -h -p :3128

The first one opens a window and shows the HTTP packages in it and the second one prints them to the standard output. Now the web client whose traffic is to be monitored is configured to use the proxy server listening to 3128 port on the local machine. In case of Firefox browser, proxy configuration are located in Edit/Preferences menu in Connection Settings panel. In case of cadaver the proxy server is adjusted in the following way:

$ cadaver
dav:!> set proxy localhost
dav:!> set proxy-port 3128

As a matter of fact cadaver has a couple of debug options which can be viewed with the command set debug, but they dump the HTTP requests and responses in a less readable format.

Иван Иванов 2006-06-23