écoute sur le port 8080

se connecte sur www.lix.polytechnique.fr:80

GET /~durr/Attic/ManInTheMiddle/index.html HTTP/1.1
Host: icare:8080
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; fr; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
If-Modified-Since: Fri, 22 Feb 2008 15:39:58 GMT
If-None-Match: "1530c5-a0f-8da4f80"

HTTP/1.1 200 OK
Date: Fri, 22 Feb 2008 15:46:24 GMT
Server: Apache/2.2.3 (Debian) DAV/2 PHP/4.4.4-8+etch4 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8
Last-Modified: Fri, 22 Feb 2008 15:46:24 GMT
ETag: W/"15323c-a87-2491a5c0"
Accept-Ranges: bytes
Content-Length: 2695
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
  <link href="/~durr/style.css" type="text/css" rel="stylesheet">
  <meta http-equiv="content-type"
 content="text/html; charset=iso-8859-1">
  <title>ManInTheMiddle</title>
  <meta name="generator"
 content="amaya 9.2.2, see http://www.w3.org/Amaya/">
</head>
<body>
<h1>The man in the middle</h1>

We provide a tool that permits to trace the communication between a server and a client, for simple protocols, that do not open an additional connection, therefore excluding for example FTP, and that exchange human readable messages, like most protocols.
<p>
Suppose you want to trace the communication exchanged between your webbrowser and this webserver.

<ul>
<li><a href=ManInTheMiddle.java>Download</a>
</ul>

The idea is that you execute it on your machine with the parameters <code>java ManInTheMiddle 8080 www.lix.polytechnique.fr 80</code>. 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 <a href="trace.html">this</a>. On the client side, in your webbrowser you type the URL
<code>http://localhost:8080/~durr/Attic/ManInTheMiddle/index.html</code>.

<p>
<pre>
------- Example of a session without ManInTheMiddle

^Iserver                                              client
^I+----+                                              +--------+
        | -- |                                              | +----+ |
        | == |<-------------------------------------------- | |    | |
        |  o | port 80                                      | +----+ |
        |    |                                              |        |
        |    |                                              |    === |
        +----+                                              +--------+

------- Example of a session with ManInTheMiddle

^Iserver     java ManInTheMiddle 8080 server 80       client
^I+----+                +-----+------+                +--------+
        | -- |                |save | clear|                | +----+ |
        | == |                +-----+------+                | |    | |
        |  o | <------------- | GET / HTTP.|                | +----+ |
        |    | port 80        |            | <------------- |        |
        |    |                | 200 ok..   | port 8080      |    === |
        +----+                +------------+                +--------+
</pre>
</body>