Computer networks -- 2007-2008 -- 4

From Wikiversity
Important! These pages are somehow outdated and it is recommended to consult the newer version at Computer networks -- 2008-2009 -- (by Ciprian Crăciun).

Quick links:


For now please consult Web technologies -- Laboratory 2 -- 2007-2008 --, especially the sections:


This is the third assignment, so please commit it to the folder assignment-03.

Implement a simple HTTP client that:

  • takes one argument from the command line -- the URL of the resource;
  • implements the HTTP/1.0 protocol, and requests the pointed resource;
  • writes the content of the resource to the standard output;
  • for any protocol or communication (socket) errors a clear message should be printed to standard error;
  • it should interpret the status codes sent by the HTTP server and for any other status than 200 a clear message should be printed (again at standard error);

For bonus points you could implement either:

  • a simple non-caching (also called transparent) HTTP proxy server -- that acts both as a HTTP server and client;
  • a POP3 command line client;
  • an IMAP command line client;