The finale board. No new mechanism: one ordinary request, followed through everything this build has already made, closing the build begun in Build Your Own HTTP Server, From Scratch.
Before you start. This series has been building a small HTTP server, a program that answers a browser’s request for a page the same way every real website does. By now it can do seven things, one per earlier lesson:
Hang up on a caller who never finishes asking, instead of waiting forever.
Find where a request’s opening line and labels end, even when the bytes (single characters, roughly) arrive in pieces.
Work out whether anything follows those labels, and how long it runs.
Send an address like /users/42 to the right piece of code.
Keep the line open and answer a second request on it.
Refuse to hold more than so many lines open, so a flood cannot sink it.
Send back a reply whose length it doesn’t know yet, piece by piece.
This lesson adds no new piece: it sends one ordinary request through all seven, in order.
Lesson 21 of 117 in From Scratch
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.