go to CIS 
home page

DCCT*3030
Winter 2006

 Home

 Course Outline 

 Group Project 

 Course Material 

 Assignments 

 Laboratories 

 Online Resources 


Comments/Suggestions


Distributed Programming I

Assignments


In addition to the project, there will be one programming assignment in this course, which is worth 5%.

Late Assignments: my policy on late assignments is very simple: NO LATE ASSIGNMENTS WILL BE ACCEPTED NO MATTER WHAT IS THE REASON. Start working early.

The assignment:

You are to construct an HTTP proxy. Web clients (browsers like IE and Netscape) send requests to the proxy. The proxy forwards the request to the appropriate HTTP server and returns the server's response to the client. Your proxy must keep logs (in a file) of all the URLs of websites the client attempts to visit. Your proxy should not allow clients to visit certain web sites. Let's say clients shouldn't be able to visit the following three web sites:

http://www.bn.com
http://www.fatbrain.com
http://www.lycos.com

Your proxy must return an appropriate error code and a message to the client when an attempt is made to visit one of these web sites. Please check the HTTP 1.0 specification or HTTP 1.1 specification to find out which error code and message should be returned.

The proxy must accept as input two command line arguments that specify the port number (first argument) to listen to incoming connections and the name of the log file (second argument) as follows:

Example: java Proxy 1700 log

The format of the log file should be as follows:

RequestedURL <allowed>
RequestedURL <NotAllowed>

Here is an example log file:

http://www.google.com <Allowed>
http://www.lycos.com <NotAllowed>
..
..
..
Notes and Marking Guidelines:
  • This assignment will be marked out of 20
  • This assignment is due on Tuesday, January 31 (AT START OF LAB at 9:55am). You have 30 minutes grace period. No assignments will be accepted (NO MATTER WHAT IS THE REASON) after 10:30am on Tuesday, January 31. Assignments found in my mailbox will not be accepted even if timestamped.
  • Your proxy should continue to handle requests until it is manually terminated (i.e. it is multi-threaded).
  • You MUST use Java sockets (in other words, you cannot use the URL and URLConnection classes in this assignment. If you do you will automatically lose 15 marks).
  • The name of your main class (in case you are going to have more than one) must be Proxy.
  • Hand in a disk containing Proxy.java and any other utility classes (hand in source code only please, the TA will compile your code). These classes should be at the root directory (i.e. no subdirectories on the disk). Your proxy will be tested on a Windows machine using the command:

    java Proxy portNum LogFile

    If this doesn't work you will lose 4 marks automatically, then we will try to figure out how to run your Proxy.

  • If your proxy hangs in the middle of a connection, it will be tested again. If this behavior persists this means your proxy is not completely functional (could be a problem with your threads) and you will lose 10 marks.

You will find the HTTP 1.0 specification or HTTP 1.1 specification to be helpful

If you have any questions please see me during my office hours or make an appointment. If you like to ask questions via e-mail please keep the following in mind:

  • Please allow at least 2 working days (weekend is not counted) to get an answer for your question. For example, if an assignment is due on a Tuesday morning you should send me your questions by Thursday afternoon in order to receive an answer by Monday morning.
  • Please do not email me your code for debugging. If you see me during my office hours I'd be happy to help you debug it.


Copyright © Qusay H. Mahmoud , University of Guelph.