ME8 – Simple Non-concurrent Web Server
[20%] Run webserver at port 54321. Use a web browser as client.
[30%] Parse the HTTP request (using strtok) received from the web browser and obtain the name of the object requested.
HTTP Request Message format: http://www.tcpipguide.com/free/t_HTTPRequestMessageFormat.htm
For example, index.html will be sent in the response:
GET /index.html HTML/1.1
Host: localhost:54321
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:15.0) Gecko/20100101 Firefox/15.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[30%] Send the HTTP response as follows:
HTTP/1.1 200 OK
Content-type: text/html
Content-length:
HTTP Response Message format: http://www.tcpipguide.com/free/t_HTTPResponseMessageFormat.htm
[20%] Must be able to handle html, CSS and common image formats (jpg, gif, png)