Skip to content
Back to the catalog
Project http-serverNetworkingIntermediateBeta

An HTTP server from the socket up

From raw bytes to a 200 response. Parse requests, manage connections and serve concurrent traffic.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

You use web frameworks every day, but underneath all of them sits the same thing: a TCP socket listening, and a text protocol that fits on one page. This challenge takes the framework out of the way.

You start by opening a socket by hand and finish with a server that parses real requests, serves files, understands headers and handles several clients at once without blocking. You'll test it with curl and with your browser.

Roadmap

10 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 12 stages

    Speaking TCP

    Open a socket, accept a connection and return a hand-written 200.

    1. 01Minimal HTTP response
    2. 02Connection reading
  2. Phase 23 stages

    Parsing real HTTP

    Request line, headers, body, and well-formed error responses.

    1. 01Request line
    2. 02Headers
    3. 03Body and errors
  3. Phase 33 stages

    Serving content

    Path routing, static files, Content-Type and POST handling.

    1. 01Routing
    2. 02Safe static files
    3. 03POST and JSON
  4. Phase 42 stages

    Holding up under load

    Concurrency, keep-alive and timeouts so it doesn't fall over with several clients.

    1. 01Concurrent clients
    2. 02Keep-alive and timeouts

Before you start

An HTTP/1.1 server written on top of TCP sockets: it accepts connections, parses the request line and headers, routes by path, serves static files with the right Content-Type, handles POST bodies, keeps connections alive and serves concurrent requests.

  • bittorrent
    Beta

    A BitTorrent client

    Bencode, trackers and the peer-to-peer protocol. Download a real file by talking to real peers.

    Advanced12 stages~20 hNetworking
    bencodep2pprotocolos+1

    Go · Python · Java

  • dns-resolver
    Beta

    A DNS resolver

    Build and parse UDP packets bit by bit. Resolve names by walking the hierarchy from the root servers.

    Intermediate8 stages~9 hNetworking
    udpbinarioprotocolos

    Go · Rust · Python

  • mcp-server
    Beta

    Build an MCP server

    Build a Model Context Protocol server from scratch with JSON-RPC, tools, and resources.

    Intermediate5 stages~12 hNetworking
    mcpjson rpcagentes+1

    TypeScript · Python · Go