Skip to content
Back to the catalog
Project http-serverNetworkingIntermediateComing soon

Build your own HTTP server

Build an HTTP server from scratch. Parse requests from socket bytes, manage connections and serve concurrent traffic with real HTTP responses.

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

Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.

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.

  2. Phase 23 stages

    Parsing real HTTP

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

  3. Phase 33 stages

    Serving content

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

  4. Phase 42 stages

    Holding up under load

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

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.

  • mcp-server
    Beta

    Build your own MCP server

    Build an MCP server from scratch. Implement Model Context Protocol with JSON-RPC, tools and resources to connect AI clients to your programs.

    Intermediate5 stages~12 hNetworking
    MCPJSON-RPCagents+1

    TypeScript · Python · Go

  • bittorrent
    Coming soon

    Build your own BitTorrent client

    Build a BitTorrent client from scratch. Decode bencode, contact trackers and download a real file through the peer-to-peer protocol.

    Advanced12 stages~20 hNetworking
    bencodeP2Pprotocols+1

    Go · Python · Java

  • dns-resolver
    Coming soon

    Build your own DNS resolver

    Build a DNS resolver from scratch. Encode and parse UDP packets, then resolve domain names by walking the hierarchy from root servers.

    Intermediate8 stages~9 hNetworking
    UDPbinaryprotocols

    Go · Rust · Python