Webserv is a high-performance, non-blocking HTTP/1.1 server written in C++98. Inspired by the efficiency and architecture of NGINX, it uses I/O multiplexing to handle thousands of concurrent connections with minimal resource usage.
- HTTP/1.1 Support: Full implementation of
GET,POST,DELETE, andPUTmethods. - I/O Multiplexing: Scalable architecture using
poll/selectfor non-blocking I/O. - CGI Support: Execute dynamic scripts (Python, PHP, Perl, etc.) via Common Gateway Interface.
- Virtual Servers: Host multiple websites on different ports or hostnames.
- Auto-Indexing: Dynamic directory listing generation.
- File Uploads: Built-in support for client-side file uploads.
- Customization: Fully configurable via an NGINX-style configuration file.
- Docker Ready: Easy deployment with a pre-configured Docker environment.
- C++ Compiler (GCC or Clang)
- Make
- Docker (Optional)
make
./nginx++make upThe server will be accessible at http://localhost:8080 (or as configured in servIO.conf).
Deep dive into the server's internals and configuration:
- Architecture Overview: Understand the core design, I/O multiplexing, and request lifecycle.
- Configuration Guide: Learn how to set up virtual servers, routes, and custom error pages.
- CGI Guideline: Instructions on enabling and using dynamic scripting.
webserv/
├── Configuration/ # Config parser and data structures
├── Core/ # Server loop, socket management, selector
├── Http/ # HTTP protocol logic (Request/Response)
├── Parser/ # Lexer and parser for servIO.conf
├── includes/ # Project-wide headers and constants
├── utils/ # Helper functions
└── www/ # Default web root
This project is licensed under the MIT License - see the LICENSE file for details.