A non-blocking HTTP/1.1 server written in C++, inspired by NGINX.
Webserv is a lightweight, event-driven HTTP server built using C++ and epoll(). It is designed to handle multiple requests efficiently while remaining non-blocking. It supports GET, POST, and DELETE methods and can execute Python scripts via CGI.
- @Welhox – Developed and implemented full HTTP response handling, including the core functionalities of GET, POST, and DELETE methods on the server side.
- @tcampbel22 – Configuration file parsing, Logger
- @codinggolfer – Request parsing
- CGI support & main server loop developed together
✅ Non-blocking I/O (using epoll())
✅ CGI support for executing Python scripts
✅ Custom error pages at different levels: location block, server level, and default error handler
✅ Directory listing with resource links
✅ Multiple server instances
✅ Basic file upload support
✅ Configuration-based setup (similar to NGINX)
Requirements:
- A Linux environment (due to
epoll()usage) makeandg++are required to compile the project. If they are not installed, you can install them using:sudo apt update && sudo apt install build-essential
git clone https://github.com/Welhox/webserv.git
cd webserv
makeTo start the server, provide a configuration file:
./webserv config/server.confDefault Address: 127.0.0.1:8081
Webserv reads configurations from a file (similar to NGINX). Example configuration files can be found in the config/ directory.
server {
host 127.0.0.1
port 8081;
server_name myserver;
error_page 404 /errors/404.html;
location / {
root /root/var/html;
index index.html;
methods GET;
}
location /cgi-bin/ {
cgi_path /root/bin/cgi/;
cgi_script cgitester.py;
}
}


