Your assignment is to construct an HTTP proxy that parses the request, 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 on for 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.
$ http_pproxy 2434
should set the server to listen on TCP port 2434 for HTTP connections to process.
HTTP 1.0 Specification at http://www.w3.org/pub/WWW/Protocols/HTTP/1.0/spec.html
Submission information and input file are here.
For extra credit, make the proxy concurrent (i.e. using fork, threads, or asynchronous control) [2%]. The proxy must "reap" it's children if it forks. And/Or allow the proxy to handle FTP requests as well as HTTP request [5%].