Nae
2026-10-27
A simple, lightweight HTTP server built from scratch in C++.
It is a basic HTTP/1.1 server implementation in C++. It's designed to be a learning tool for understanding the fundamentals of network programming and the HTTP protocol. The server can handle basic GET requests, serve static files, and has a simple routing mechanism.
Features
- Handles GET requests
- Serves static files from the public directory
- Basic routing for /, /health, and a 404 page
- Non-blocking I/O using poll() for handling multiple connections
Usage
Once the server is running, you can interact with it using a web browser or a tool like curl.
- Root: http://localhost:8080/ - Serves the index.html file.
- Health Check: http://localhost:8080/health - Returns a "200 OK" status.
- Static Files: http://localhost:8080/styles.css - Serves the styles.css file.
- Not Found: http://localhost:8080/foo - Returns a "404 Not Found" error.