Now that we have played with the HTTP protocol, e.g by issuing requests and specifying HTTP headers, let us see how a Web server work by programming a small server, that is only able to handle GET requests.
![]() | Exercise 1.7. Using our server |
|
Now, we can request our server (defined and run as shown in Exercise 1.6) with ... a telnet interactive session as in the first exercises of this practical session. % telnet feu.sis.pasteur.fr 2122 Trying 157.99.60.151... Connected to feu.sis.pasteur.fr. Escape character is '^]'. GET tralalaitou HTTP/1.0 User-Agent: telnet + my fingers Connection: keep-alive HTTP/1.0 200 OK Server: BaseHTTP/0.2 Python/2.2 Date: Tue, 18 Feb 2003 17:15:49 GMT Content-Type: text/html Server: myHandler <html> <body> <p>GET string: tralalaitou</p> <ul> <li><b>connection</b>: keep-alive </li> <li><b>user-agent</b>: telnet + my fingers </li> </ul> </body> </html> Connection closed by foreign host. % | |
![]() | Exercise 1.8. Using our server with a standard Web browser |
|
Now, we can of course also request our simplistic server with a proper Web browser. First check that the server is running, and launch a browser on the following url: http://feu.sis.pasteur.fr:2122/tralalilaeere. | |