All projects
Webserv
RFC-compliant HTTP/1.1 server in pure C++
A web server written from scratch in C++ with no external library: RFC 7230-compliant HTTP/1.1 parsing, I/O multiplexing and CGI script execution.
Screenshots
Context
Reimplementing a web server straight from the RFC reveals everything frameworks hide: header parsing, persistent connections, the exact semantics of every status code. The real difficulty lies elsewhere — serving several clients at once on a single thread means never blocking, which means driving everything through `select()` and tracking the state of each connection yourself. The server is configured through a file whose format is close to nginx.
Features
- Complete, RFC-compliant HTTP/1.1 server
- I/O multiplexing with select() on a single thread
- Concurrent handling of multiple clients
- CGI support (PHP, Python, shell scripts)
- Flexible configuration-file parsing
- Full HTTP error-code handling