Build your own Web Server
An HTTP/1.1 server on raw TCP sockets: parse requests, serve static files, and handle many clients at once.
- Intermediate
- About 8–16 h
- 5 checkpoints
- 4 tutorials · Node.js, Python
Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.
Choose a tutorialWhy build it
Frameworks hide the protocol. Parsing requests yourself teaches what headers, status codes, keep-alive and Content-Length really do, and why one slow client can stall a naive server.
You will be able to
- Accept TCP connections and parse HTTP/1.1 request lines and headers.
- Return correct status codes, content types and lengths.
- Serve concurrent clients with threads, processes or an event loop.
- Refuse path traversal and oversized requests.
Skills it exercises
Recommended on Backend Engineer and Network Engineer.
How you know you are there
Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.
- Checkpoint 1Self-check
Echo over TCP
Done when: The server listens on a port and
nc localhost 8080gets back what it sends. - Checkpoint 2Self-check
Parse and respond
Done when:
curl -v localhost:8080/gets a valid HTTP/1.1 response with Content-Type and Content-Length, and malformed requests get 400. - Checkpoint 3Self-check
Static files
Done when: Files under a public directory are served with the right MIME type, missing ones return 404, and
/../etc/passwdis refused. - Checkpoint 4Self-check
Concurrency
Done when: Ten idle
ncconnections do not block a normal request, and a load test (ab or hey) completes without errors. - Checkpoint 5Self-check
Keep-alive and limits
Done when: Persistent connections are reused, idle ones time out, and request bodies over a set size get 413.
Stretch goals
- Chunked transfer encoding.
- TLS with your language's TLS library.
- A router and middleware layer on top (see Build your own Web Framework).
Step-by-step guides
Pick one in a language you know (tutorial languages: Node.js, Python). They open on the author’s site.
- Node.js
Build Your Own Web Server From Scratch In JavaScript(external site)
Node.js and TypeScript book: event loop, HTTP semantics, chunked encoding and streaming.
- Python
Let’s Build A Web Server.(external site)
Python, three parts: from a single socket to handling many clients.
- Python
A Simple Web Server(external site)
Python: a short chapter focused on design choices.
- Node.js
Let's code a web server from scratch with NodeJS Streams(external site)
Node.js streams on raw TCP.
Where to go next
- Build your own Web Framework
Intermediate · 8–15 h
- Build your own Load Balancer
Intermediate · 6–12 h
Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.
Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.