Skip to content

Files

Latest commit

 

History

History
33 lines (26 loc) · 1.59 KB

README.md

File metadata and controls

33 lines (26 loc) · 1.59 KB

Web server test suite

Implement a Web server. Libraries for helping manage TCP socket connections may be used (if server is asynchronous epoll must be used). Libraries that implement any part of HTTP or multiprocessing model must not be used.

Requirements

  • Respond to GET with status code in {200,403,404}
  • Respond to HEAD with status code in {200,404}
  • Respond to all other request methods with status code 405
  • Directory index file name index.html
  • Respond to requests for /<file>.html with the contents of DOCUMENT_ROOT/<file>.html
  • Requests for /<directory>/ should be interpreted as requests for DOCUMENT_ROOT/<directory>/index.html
  • Respond with the following header fields for all requests:
    • Server
    • Date
    • Connection
  • Respond with the following additional header fields for all 200 responses to GET and HEAD requests:
    • Content-Length
    • Content-Type
  • Respond with correct Content-Type for .html, .css, js, jpg, .jpeg, .png, .gif, .swf
  • Respond to percent-encoding URLs
  • No security vulnerabilities!
  • Bonus: init script for daemonization with commands: start, stop, restart, status

Testing

  • httptest folder from http-test-suite repository should be copied into DOCUMENT_ROOT
  • Your HTTP server should listen localhost:80
  • http://localhost/httptest/wikipedia_russia.html must been shown correctly in browser
  • Lowest-latency response (tested using ab, ApacheBench) in the following fashion: ab -n 50000 -c 100 -r http://localhost:8080/