Your assignment is to write a simple Web server using Java or your preferred programming language. Use HTTP v. 1.1. Implement only the features indicated below. Full details on HTTP/1.1 can be found at www.w3.org/Protocols/rfc2616/rfc2616.html.
GET — Request from client (browser) for file. Syntax: GET path version The request is normally followed by several headers. Sample GET request: See image.
Note: your server usually can ignore headers that it doesn't understand. It cannot ignore the connection header.
Server Response: See image.
HEAD — Request from client for header data A HEAD request and reply are the same as a GET request and reply, except that in the HEAD reply nothing follows the headers (even though the header will say it does).
POST— client sends data to server. You are not expected to implement POST.
Server Status Codes: You are expected to implement these. You must have prepared-in-advance 400, 404, and 500 pages. Implement 500 with exception handling.
Host: hostname[:port] Hostname and port with which the client is addressing the server. Remember, one server may have multiple domain names, so this way it can find out which domain name the client is addressing.
File Paths: Your server could assume that Web pages are stored in the same directory as the web server program. You choose port number 8000 for your Web service.
Your server should use TCP, not UDP, for transport, because reliability is important to the application. This server must be a concurrent server to handle multiple requests efficiently. Use the multithreaded TCP server example as the starting point.