Auditor
Introduction
Auditor (aud-i-tur') From Latin. audi-re. to hear. One who listens.
One of the most useful debugging techniques is logging and analyzing program activity or auditing it. Few people can hide information from a determined IRS auditor. Few programs can hide information from a well designed auditing program.

The auditor presented here is a network protocol logging program. It can easily be modified to do other things, however. Auditor works by stepping in transparently between client and server.

 Normally a client and aserver interact through a network connection. The connection is initiated by the client, and is accepted by the server (possibly after authentication). After authentication, the client makes one or more service requests which are processed by the server. The connection is then terminated. This basic procedure is the same for any kind of server, be it a database server or an HTTP server.
The auditor comes in between the two. The auditor accepts the clients requests and passes them to the server. The server's reply is sent back to the client. The client thinks the auditor is the server and the server thinks the auditor is the client. Meanwhile, the auditor is free to log, analyze or even modify the messages that flow between the client and the server.

This is exactly what makes the Auditor a great debugging tool. If you are writing a Server or client for any Protocol, the auditor can help you debug it.

Auditor is also a great educational tool. You can use it to learn or teach how certain programs really work.

Example
Let us suppose we wish to know how the HTTP clients and servers work. We would do the following:
java Auditor www.netscape.com 80 9000
(Actually, since 80 and 9000 are defaults, we could as well have said:
java Auditor www.netscape.com)

This creates an Auditor at port 9000 on the current machine that Audits the server at www.netscape.com port 80, the HTTP port. Suppose we want to study the Netscape web browser. All we have to do is point the browser at our site. We do this by opening the url http://our_host:9000.

The Auditor faithfully logs every bit of information that passes between them. You can modify the auditor to do marvelous other things, of course.

Try it out! It's fun! Check out the difference between Internet Explorer and Netscape!

You need some sort of Java environment (such as Sun's JDK) installed on your machine.

Download the source and classes.
 

E-mail Home Projects Docs Download Credits