Web Programming Project: HTTP 1.1 Web Server
Internet and Intranet Protocols and Applications
Prof. Arthur P. Goldberg
Write a partly functional HTTP/1.1 server. Your server should deliver files from the filesystem in response to GET requests.
In writing an HTTP server you will learn about server socket programming, HTTP message semantics, formats and headers, and URL parsing.
You may write your HTTP server in any commonly used programming language you wish and run it on any machine you wish. You will help us grade your server by having it communicate via TCP/IP with a grading program. The grading program will access your server and check its operation. Details will follow later.
This assignment is due on 4/29 and is worth 40 points. Your implementation of the server is worth 30 points. Questions about your serverís design and implementation will be worth 10 points.
Your server should support:
Your server must implement all "MUST" functionality in the following sections of the HTTP/1.1draft specification version 2. Naturally, only implement the functionality required for servers-ignore functionality required for proxies and clients.
3 Protocol Parameters
3.1 HTTP Version, 3.2 Uniform Resource Identifiers, 3.2.1 General Syntax, 3.2.2 http URL, 3.3 Date/Time Formats, 3.3.1 Full Date, 3.6 Transfer Codings, 3.6.1 Chunked Transfer Coding, 3.6.2 Identity Transfer Coding
4 HTTP Message
4.1 Message Types, 4.2 Message Headers, 4.3 Message Body, 4.4 Message Length, 4.5 General Header Fields
5.1 Request-Line, 5.1.1 Method, 5.1.2 Request-URI, 5.2 The Resource Identified by a Request
6.1 Status-Line, 6.1.1 Status Code and Reason Phrase
7.1 Entity Header Fields, 7.2 Entity Body, 7.2.1 Type, 7.2.2 Entity Length
8.1 Persistent Connections, 8.1.1 Purpose, 8.1.2 Overall Operation, 8.1.4 Practical Considerations, 8.2 Message Transmission Requirements, 8.2.1 Persistent Connections and Flow Control
9 Method Definitions
9.3 GET, 9.4 HEAD, 9.8 TRACE
10.2.1 200 OK, 10.4.5 404 Not Found, 10.5.1 500 Internal Server Error, 10.5.2 501 Not Implemented, 10.5.6 505 HTTP Version Not Supported
14 Header Field Definitions
14.10 Connection, 14.13 Content-Length, 14.17 Content-Type, 14.18 Date, 14.22 From, 14.23 Host, 14.24 If-Modified-Since, 14.38 Server, 14.41 Transfer-Encoding
Incorporate the following modifications to the specification.
4.4 Ignore paragraph 4 which begins " if the message...".
5.1.1 Build only GET HEAD TRACE
8.1.4 Add "server MUST time out an inactive connection".
Command line options should include the inactive connection time-out duration, and the chunk message size. Note that your server MUST ignore requests from HTTP versions other than 1.1, 1.0.
Start by studying the following
I recommend you implement one of three servers styles:
I recommend that to simplify your task, you build your server incrementally. Also, make certain that you handle all error codes returned by system calls and library routines. Avoid deadlock.
You may write your server in any commonly used programming language such as C, C++, Java, PERL, Pascal, Ada, Fortran, etc.
Write your server against an operating system sockets networking layer.
As always, you can ask the TA Jianjun Qiu (firstname.lastname@example.org) or me advice in class and via email. Jianjun will be responsible for this programming assignment, helping students understand the assignment and technology (not doing the assignment for them), and grading. You may help each other to understand the problem and the properties of HTTP servers. You're welcome to post questions to our class mailing list.
You must write all the programs and answers you hand in by yourself. (Except that I expect your code will include fragments of the server in Comer.) Please do not incorporate code from free servers available on the network.
As I expect you know, passing in another person's work is cheating, morally wrong, not helpful to your education, and against NYU's rules. We use programs that compare your assignments and can detect copying, even if the copy has been modified. Finally, I become extremely angry when I discover cheating.
The grading program will access your server and check its operation. Details will follow later. Note that your server must run on the machine which can be accessed by a grading program running at NYU.
When we grade your program we will ask you to create a specific filesystem structure, including filenames, sizes and modification dates, so our grading program can access your server. We will ask you to transfer some files as a "chunked transfer coding". You will need to tell our grading program which machine and port number your server listens on.