Implementation of the HTTP/1.1 server (limited) from scratch leaning on the relevant RFC's as well as the net/http library in Golang.
To run the server you will need Golang. I used 1.25.1, but I'm quite sure it's backwards compatible (but not too backwards). Install Golang here.
Each commit (for better or worse) represents a lesson from boot.dev course below. Note that the last lesson titled "Binary Data" requires to complete the curl to pull the video.
Run the server (assuming the pwd is root) with:
go run cmd/httpserver/main.go
Almost all of the code was written without AI (apart from some menial tasks in certain lessons). As you can see I'm not a fan of the seemingly idomatic way of Go's declarations using :=, so I don't use it at all. The tests however were written to major extend by AI (Codex specifically), thus := is in constant use there.
- Plain TCP handling with custom request/response types
- Chunked proxy responses with trailer hashing
- Simple static routes, including a demo MP4 streamer
Distributed under the MIT License. See LICENSE for details.