Webserv is a C++ project from the 42/1337 curriculum where the goal is to implement a fully functional HTTP server from scratch.
This project helps you understand how web servers work internally, including request handling, response generation, and client-server communication.
- Build a custom HTTP server (like Nginx or Apache)
- Handle HTTP requests and responses
- Support multiple clients
- Manage routes and configurations
- Implement methods such as GET, POST, DELETE
- Handle errors and HTTP status codes
- HTTP/1.1 protocol support
- Multiple client handling (non-blocking I/O)
- Config file parsing
- Routing system
- CGI support (optional depending on implementation)
- Static file serving
- Error handling (404, 405, etc.)
- C++
- Socket programming
- I/O multiplexing (select, poll, or epoll)
- HTTP protocol
- Unix system calls
webserv/
├── src/
├── includes/
├── config/
├── server/
├── client/
└── main.cpp
make
./webserv config_file.conf
📡 Example Usage
Open your browser and go to:
http://localhost:8080
🧠 What I Learned
How HTTP works internally
Socket programming in C++
Event-driven programming
Handling multiple clients efficiently
Server architecture and design
⚠️ Notes
This project is complex and requires a good understanding of networking
Proper error handling is essential
Memory leaks must be avoided
Performance and scalability are important
👩💻 Author
Somaya-Hassoune – 1337 Student