Skip to content

elbouzkri/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webserv

C++ License Protocol

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.


🚀 Key Features

  • HTTP/1.1 Support: Full implementation of GET, POST, DELETE, and PUT methods.
  • I/O Multiplexing: Scalable architecture using poll/select for 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.

🛠️ Quick Start

Prerequisites

  • C++ Compiler (GCC or Clang)
  • Make
  • Docker (Optional)

Building the Server

make
./nginx++

Running with Docker

make up

The server will be accessible at http://localhost:8080 (or as configured in servIO.conf).


📂 Documentation

Deep dive into the server's internals and configuration:


🏗️ Project Structure

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

👥 Authors


📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Webserv is an HTTP server built from scratch in C++ that implements the HTTP/1.1 protocol and supports CGI for dynamic content handling. It leverages multiplexing to manage multiple client connections efficiently, providing a scalable and performant solution for serving web content.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors