Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peb

Peb is a C++17 HTTP/HTTPS server and reverse proxy with multiple concurrency models.

Features

  • Thread-pool server – one blocking thread per connection, HTTP/1.1
  • Epoll + io_uring server – non-blocking I/O for many connections per thread
  • Reverse proxy – backend pool with health checks
  • TLS / HTTPS via OpenSSL
  • Optional mutual TLS (mTLS)
  • HTTP/2 (epoll target only)
  • WebSocket support
  • Static file serving
  • Chunked transfer encoding
  • Request body parsing (Content-Length and chunked)

Requirements

  • Linux (liburing required for epoll target)
  • CMake ≥ 3.20
  • C++17 compiler
  • OpenSSL development headers
  • liburing development headers

Debian/Ubuntu:

sudo apt install build-essential cmake libssl-dev liburing-dev

Fedora:

sudo dnf install cmake gcc-c++ openssl-devel liburing-devel

Building

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

Executables are placed in build/:

Target Description
peb Thread-pool HTTP/HTTPS server
peb_epoll Epoll + io_uring async server
peb_proxy Reverse proxy with health checks
peb_tests Unit tests
peb_benchmarks Microbenchmarks

Development certificates

Self-signed certs are generated for local testing only. Do not use in production.

./certs/gen_cert.sh
./certs/gen_client_cert.sh

Running

./build/peb [http_port] [https_port] [static_root] [cert_path] [key_path] [client_ca_path] [require_client_cert]

Example with default paths:

./build/peb 8080 8443 ./public

Demo endpoints

  • GET /api/health – { "status":"ok" }
  • GET /api/time – current Unix time
  • GET /api/stream – chunked response (5 chunks)
  • POST /api/echo – echoes request body
  • GET /api/whoami – client cert subject if using mTLS

Static files are served from static_root (default ./public).

Testing

cd build
ctest --output-on-failure

Benchmarks

./build/peb_benchmarks

About

A high-performance C++17 HTTP server and reverse proxy with multiple concurrency models, TLS/mTLS, and backend health checks. Designed for extensibility and modern protocol support.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages