Network & Sockets
Daemonization
HTTPd is a rigorous implementation of a web server capable of handling HTTP/1.1 requests.
The goal was to understand the underlying mechanisms of the web: parsing protocols, managing connections, and running as a background system service (Daemon).
Grade achieved: 77% (Successful validation of core features and stability).
The project required building a robust architecture handling the full lifecycle of a request without blocking the system.
Implementation of the TCP/IP stack using C sockets (socket, bind, listen, accept).
The server handles client connections and ensures data integrity during transmission.
A custom parser processes raw bytes into structured HTTP requests. It validates:
| Feature | Description |
|---|---|
| Daemon Mode | The server detaches from the terminal (double fork), manages PID files, and handles signals (SIGINT, SIGTERM) for graceful shutdowns. |
| Configuration | Dynamic loading of settings (Port, IP, Root Directory) via a configuration file. |
| Virtual Hosts | Basic support for vhosts to serve different content based on the requested Host header. |
| Logging | Detailed access logs allowing traffic monitoring and debugging. |
This project provided deep insights into network programming and system calls. Handling the strict constraints of the HTTP RFC taught me precision in protocol implementation and memory management in long-running processes.