SwiftServe

This is a lightweight, zero-dependency HTTP/1.1 server written in modern C++20. Built for speed, simplicity, and learning.

C++20 · Linux · macOS

Non-Blocking I/O

Event-driven architecture using poll() for efficient handling of thousands of concurrent connections.

Static File Serving

Serves files with correct MIME types, directory listings, and automatic index.html resolution.

Regex Routing

Register handlers for GET, POST, PUT, DELETE with full regex pattern matching on URL paths.

Range Requests

Supports byte-range serving for large files and resumable downloads out of the box.

Keep-Alive

Persistent connections for HTTP/1.0 and HTTP/1.1, reducing latency on repeated requests.

Zero Dependencies

No external libraries required. Just a C++20 compiler and the standard library.

terminal
# Clone and build
git clone https://github.com/nayandas69/swiftserve.git
cd swiftserve
make

# Run the server
./swiftserve -p 8080 -d ./public

# Open http://localhost:8080 in your browser