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 01 · Portfolio Projects · Build It Yourself · with code: Go · about 15 min to read

Play it as a journeyTutor comes with a plan

S4 · Build an HTTP Server (without net/http)

S2 - Build a Load Balancer
S2 - Build a Load Balancer · Open board

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.

See plansAlready a member? Sign in

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.

Review Portfolio Projects