Peb is a C++17 HTTP/HTTPS server and reverse proxy with multiple concurrency models.
- 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)
- 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-devFedora:
sudo dnf install cmake gcc-c++ openssl-devel liburing-develcmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -jExecutables 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 |
Self-signed certs are generated for local testing only. Do not use in production.
./certs/gen_cert.sh
./certs/gen_client_cert.sh./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- 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).
cd build
ctest --output-on-failure./build/peb_benchmarks