CS 268 - Assignment 1: HTTP Privacy Proxy


Given: January 19, 1998
Due: February 16, 1998
Language Options: C, C++, or Java
OS Options: It must run on Solaris 2.5.1

Your assignment is to construct an HTTP proxy that strips all requests of headers, contacts the web server, retrieves the data and sends it back to the original client. The program must accept as input a command line argument that specifies the port number to listen to incoming connections. Informative error messages should be sent back to the client for connection failures and hostname lookup problems. The server should display information as to the request it receives and if it was successfully retrieved or not.

Errors from the proxy should be formatted and displayed in an informative and readable form.

Example

http_pproxy 2434

should set the server to listen on TCP port 2434. Output from the server should look like:


Request from 157.182.194.28 port 63546 for "http://cnn.com/"....retrieved.
Request from 157.182.194.14 port 2546 for "http://xouch.com/"....host not found.
HTTP 1.0 Specification at http://www.w3.org/pub/WWW/Protocols/HTTP/1.0/spec.html

Extra Credit

Value: up to +5% onto final grade

For extra credit, make the proxy concurrent (i.e. using fork) [3%]. The proxy must "reap" it's children if it forks. And/Or create a log file and write request information to it as requests are handled [2%]. The file must be flushed after each write.


Todd L. Montgomery (revised 01.19.1999)