Skip to content

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. Each commit is based on an assignment from the boot.dev lessons, and implements itteratively the HTTP parser and the rest of the protocol features.

License

Notifications You must be signed in to change notification settings

RegistersNinja/httpfromtcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP From TCP

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.

Installation and Running

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

Notes About the Code

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.

Highlights

  • Plain TCP handling with custom request/response types
  • Chunked proxy responses with trailer hashing
  • Simple static routes, including a demo MP4 streamer

License

Distributed under the MIT License. See LICENSE for details.

Learn More

About

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. Each commit is based on an assignment from the boot.dev lessons, and implements itteratively the HTTP parser and the rest of the protocol features.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages