Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · From Scratch · HTTP Server · with code: Go · about 18 min to read

Play it as a journeyTutor comes with a plan

Build Your Own HTTP Server, From Scratch

The Map
The Map · Open board

The whole build laid out in order: each stage is the wall the one before it hit.

Before you start. This series builds a small copy of an HTTP server: a program that answers when a browser (or curl, or another program) asks it for something, by reading a short text question off the network and writing a short text answer back. You don’t need to know any of that text shape yet, only that two programs can send each other bytes over a wire, the way a phone call carries a voice both ways.

Boards

Code: teaching/code/from-scratch/http/: one Go module, each stage a real server: go run ./01-socket … go run ./07-chunked, then curl -i localhost:8080 or open it in a browser. No net/http: that’s the whole point.


Lesson 13 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.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 1989: papers nobody else’s machine could open
  • “Vague, but exciting”: the memo that got a yes
  • The whole trick: ask like you’d ask a librarian
  • 1990: a machine with a note taped to it
  • What the very first note said, word for word
  • 1991: the code goes out the door
  • One page worked. Then everyone wanted one.
  • One GET, end to end
  • What you can run today
  • The nine lessons
  • Go, as you go (new-to-Go markers)

Terms it explains: No `net/http`, request, response, HTTP, socket, header, framing, keep-alive, concurrency, chunked encoding, request line, blank line, body, MDN, HTTP Messages, Go `net/http` source.

Review From Scratch