CS 268 - Assignment 2: Web Server - Submission Input


You will need to use netcat to test your server. Start your server on a port of your choosing. In the input below, I will choose 2456 and I my server is the executable wwwserv.

You will need to try each URI given in the assignment as well as a random one that does not exist and a HEAD request. A typical script is given below.


$ wwwserv 2456 &
$ ~cs268/bin/nc naur 2456
GET / HTTP/1.0

HTTP/1.0 200 OK
Content-type: text/plain

[text version of information]

$ ~cs268/bin/nc naur 2456
GET /index.html HTTP/1.0

HTTP/1.0 200 OK
Content-type: text/html

[HTML version of information]

$ ~cs268/bin/nc naur 2456
GET /time HTTP/1.0

HTTP/1.0 200 OK
Content-type: text/plain

[text version of information]

$ ~cs268/bin/nc naur 2456
GET /host HTTP/1.0

HTTP/1.0 200 OK
Content-type: text/plain

[text version of information]

$ ~cs268/bin/nc naur 2456
GET /user HTTP/1.0

HTTP/1.0 200 OK
Content-type: text/plain

[text version of information]

$ ~cs268/bin/nc naur 2456
GET /random-uri HTTP/1.0

HTTP/1.0 404 Not Found
Content-type: text/html

The request URI was not available.

$ ~cs268/bin/nc naur 2456
HEAD /index.html HTTP/1.0

HTTP/1.0 501 Not Implemented
Content-type: text/html

The request method is not implemented

Extra Credit

For the extra credit, you will need to do some more work. For the basic WWW authentication, you will need to add a Authorization header for at least one request (your choice). You will need to show it accepting a request and you will need to show it rejecting a request. (That means you will need to show two requests for that part). For the Agent portion, you will need to add an Agent header to each requsst. At the end of the script, the server should exit and print out a histogram of the Agent headers.
Todd L. Montgomery (revised 03.2.2000)