Suppose you want to trace the communication exchanged between your webbrowser and this webserver.
The idea is that you execute it on your machine with the parametersjava ManInTheMiddle 8080 www.lix.polytechnique.fr 80
. This means that ManInTheMiddle listens to the port 8080, and whenever an incomming connexion is made, it opens a connexion with the server www.lix.polytechnique.fr on port 80, and sends all messages from the client to the server and from the server to the client. And on the fly it shows the communication in a window, which give traces like this. On the client side, in your webbrowser you type the URL
http://localhost:8080/~durr/Attic/ManInTheMiddle/index.html
.
------- Example of a session without ManInTheMiddle server client +----+ +--------+ | -- | | +----+ | | == |<-------------------------------------------- | | | | | o | port 80 | +----+ | | | | | | | | === | +----+ +--------+ ------- Example of a session with ManInTheMiddle server java ManInTheMiddle 8080 server 80 client +----+ +-----+------+ +--------+ | -- | |save | clear| | +----+ | | == | +-----+------+ | | | | | o | <------------- | GET / HTTP.| | +----+ | | | port 80 | | <------------- | | | | | 200 ok.. | port 8080 | === | +----+ +------------+ +--------+