Systems / network engineering
Webserv
The web stack, reduced to sockets, bytes, state, and careful failure handling.
- C++
- Linux
- Networking
- HTTP
- CGI
Overview
An HTTP/1.1 server written from scratch in C++, built to understand the machinery below familiar web frameworks.
My role
Systems design, HTTP implementation, networking, and test-driven debugging.
01 / The challenge
Designing for the real constraints.
A server must handle many partial, malformed, and concurrent requests without blocking or losing protocol correctness.
02 / The solution
A system with explicit boundaries.
A non-blocking event loop separates connection state, request parsing, routing, response construction, and resource cleanup into explicit stages.
What the system covers
01HTTP/1.1 parsing
02Non-blocking sockets
03poll() event loop
04Routing & configuration
05CGI execution
06Uploads
07Sessions & cookies
08Range requests
09Keep-alive & timeouts
Technical decisions
Engineering choices with consequences.
- Track every connection as an explicit state machine
- Treat partial reads and writes as normal
- Bound work with timeouts and payload limits
- Keep parsing independent from transport
Framework abstractions become much easier to judge after implementing the protocol behavior they hide.
GitHub TODOLive demo TODO