Your assignment is to construct a small, custom web server. The web server must only understand the GET request method. Any other method must cause the web server to return the 501 response code (Not Implemented). The web server must return the following information on specific URIs. Any other URI not on this list, should return a response code of 404 (Not Found).
| URI | Information Sent to Client |
|---|---|
/ | Hostname, IP address, Port bound to, time of day (in 'Wed Jun 30 21:49:08 1993' form), and username running server program |
/index.html | Same as above, but in nicely formatted HTML form. |
/time | Time of day in 'Wed Jun 30 21:49:08 1993' form |
/host | Hostname, IP address, and port bound to, of the host running the server program |
/user | Username of the user running the server program |
HTTP 1.0 Specification at http://www.w3.org/pub/WWW/Protocols/HTTP/1.0/spec.html
For extra credit, make the server support the basic WWW authentication method [4%]. And/Or add support for tracking Agent information and upon shutdown, print out a histogram of Agent types that have connected since the server started. [3%]