Instructions for the programming part in HW2

What to submit: You will handle two .java files and one .txt file :

  3. README.txt

Please follow these conventions, for ease of testing:

  • Use the port = 6789 for the WebServer.
  • Use localhost address.


  • Follow the instructions and use the Java code provided at the companion website.
  • For the WebServer, you can get the tcp server from the discussion examples and then change the part of the code where the Server replies to the client (it is after the connection establishment). You need to be able to handle multiple content types, and at the very minimum html.
  • The HttpRequest must implement the Runnable interface or extend the Thread class. You must be able to run a new thread for each connection request.
  • In the README.txt file, you should write a short description of your code and indicate how to run/test yourserver.