S2’s front door and the identical servers standing behind it. Every one of those backends is the program this project builds: something that reads a request off a socket and writes a response back.
Before you start. You’ve built S2, which let Go’s net/http library handle every byte of every request. This project takes that library away. You need ports and connections, and Enough Go is an optional first read. The slow build of the same server, one lesson per wall, is the From Scratch HTTP series starting at Build Your Own HTTP Server, From Scratch. This page turns that build into one repo of your own and does not repeat its detail.
Lesson 4 of 19 in Portfolio Projects
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
4 October 2004: “The first public version”
Ten thousand at once
What a web server does, one exchange at a time
Four walls between “hello” and a real server
Why build one when nginx exists
Get the code
The eight stages, each a commit
The code, stage by stage
The number for your README: the hundred-and-first request
Put it on GitHub
Terms it explains: socket, request, headers, response, body, keep-alive, cap, chunked encoding, active vs passive, health check, reverse proxy, round-robin.