This chapter builds on the previous one by looking at the HTTP protocol from the server's perspective. In it, we will build a simple web server. This web server will work using the HTTP protocol, and you will be able to connect to it with any standard web browser. Although it won't be full-featured, it will be suitable for serving a few static files locally. It will be able to handle a few simultaneous connections from multiple clients at once.
The following topics are covered in this chapter:
- Accepting and buffering multiple connections
- Parsing an HTTP request line
- Formatting an HTTP response
- Serving a file
- Security considerations