8000 GitHub - michmos/42_webserv: HTTP/1.1 compliant webserver written in C++
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

michmos/42_webserv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebServ - HTTP Server from Scratch

by Merel, Chriss and me.

About

This is a HTTP/1.1 compliant webserver built from scratch in C++. It is designed for efficiency, scalability, and configurability, using non-blocking I/O and a single epoll instance 6776 to handle clients simultaneously without blocking.

Features

  • HTTP/1.1 compliant: Supports GET, POST, and DELETE methods
  • Non-blocking I/O through epoll
  • Nginx-like configuration:
    • Multiple server blocks with customizable settings:
      • Port and host binding
      • Server name routing
      • Custom error pages
      • Client body size limits
    • Advanced routing and location blocks:
      • HTTP redirection
      • Directory listing (enable/disable)
      • Default index file selection
  • CGI support:
    • Execute scripts in various languages (e.g., Python, Bash)
    • Configurable CGI timeout to prevent resource exhaustion
    • Restricts CGI execution to specific directories for security
  • Stress-tested using Siege benchmarking tool

Usage

# Clone the repository
git clone https://github.com/michmos/42_webserv.git

# Navigate to the project directory
cd 42_webserv

# Compile the project
make

# Create a new configuration file under configs/ or adjust an exisiting one
# (see example configs in configs/)

# Run the server with default configuration (running on localhost:8080)
./webserv

# Or specify a configuration file
./webserv config_file.conf

About

HTTP/1.1 compliant webserver written in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 68.0%
  • Python 17.5%
  • Shell 7.1%
  • HTML 4.3%
  • CSS 1.5%
  • Makefile 1.3%
  • Ruby 0.3%
0