Spring 1999
You have been hired by Fox & Scully to develop a proxy web server that will track all the web sites visited by FBI personnel. Fox suspects that various factions within the FBI are using the WWW to communicate with aliens, your program will help by providing a log of all WWW accesses including the originator and requested URL. Your server should attempt to find out the identity of the user submitting each http request by using a authentication lookup as described in RFC 931. Some machines within the FBI don't run RFC 931 (a.k.a authd) servers, so your proxy server must be able to handle this condition (your server shouldn't die if it cannot contact an authd server).
Your server needs to handle only GET requests, you can ignore any other request methods. Your server should forward all HTTP headers included in a request to the target web server, and should send the complete reply back to the client (headers and contents).
Your server should print (to stdout) out the port number it is running on as soon as it starts. Using a fixed port number may make it difficult for us to grade (and for you to debug), so we suggest you allow the operating system to assign you any available TCP port. The initial line printed by your program should include the port number and nothing else (not "Port = 3838\n", just "3838\n"). Your program will be run by an automated system that expects this output.
To keep track of all requests, your server should print one line (to standard output) for each request serviced. The line should contain the username of the client (as returned by the RFC 931 lookup, or "unknown" if a RFC 931 server could not be contacted or any other failure occurred during the RFC 931 lookup), the host name of the client, and the original request sent by the client (not any of headers that accompanied the request). For example, the following lines would be printed if the user "skinner" on the machine xfile.fbi.gov was surfing the web:
skinner@xfile.fbi.gov: GET http://www.yahoo.com/headlines/news/ HTTP/1.0 skinner@xfile.fbi.gov: GET http://www.thewordistruth.org/ HTTP/1.0 skinner@xfile.fbi.gov: GET http://www.cs.rpi.edu/~hollingd/netprog/ HTTP/1.0
You should submit all the source code necessary to build your server and a makefile. Submission instructions are here. You must also include a brief writeup in a file named README that includes the following:
Make sure your code will build and run on the CS BSD machines. If you want to get fancy and write a concurrent server, you must not develop the code on an RCS machine (use the CS machines).
Most other browsers can also be set up to use a proxy server. Now all HTTP requests made using Netscape will be sent to your server. Make sure you switch back to "Direct Connection to the Internet" when you are done debugging your proxy server!