Project 0: Web server
Your first project, the hello system design world, is to design and implement a simple web server. Your web server will be able to receive and handle HTTP requests from any client through the network in parallel. In the end, you should be able to serve web pages that a regular web browser, e.g., Firefox, should be able to query and display.
We will help you on this first project by guiding you in the design of this system. Every week, we will implement a new part of the system:
- Set up the networking: Initialise the network with sockets, and write a small client that connects to your server. You can use the sockets cheat sheet to help you.
- Process HTTP requests: you should be able to receive well-formed HTTP requests from arbitrary client. You will need to get requests from the network, parse them and implement the methods to serve them. You should focus on having a working implementation of the handling of GET requests. You can use the HTTP cheat sheet to see how to parse and handle requests.
- Multithreading: Set up multithreading to be able to serve multiple requests in parallel. You can do this by creating one thread per connection, or by managing a pool of worker threads and a request queue.