HTTP server.
Written in Zig.

HTTP/1.1, HTTP/2, and HTTP/3 over QUIC. Reverse proxy, TLS 1.3, rate limiting, observability, native x402 payments. Single binary, no runtime dependencies.

HTTP/1.1 ──┐ HTTP/2 ──┼──► swerver ──► kqueue/epoll/io_uring ──► your code HTTP/3 ──┘ └── QUIC (RFC 9000-9002)
274K
req/s (laptop)
328μs
avg latency
3
HTTP versions
1
binary

Built for production

Everything you need to run production traffic. One binary, no runtime dependencies.

protocols

HTTP/1.1 + HTTP/2 + HTTP/3

Full protocol support including HPACK compression, QUIC transport, and keep-alive connection pooling.

proxy

Reverse proxy

Load balancing, health checks, WebSocket proxy, gRPC-aware routing. Traffic splitting for canary and blue-green deploys.

security

TLS 1.3 + mTLS

SNI multi-certificate TLS, mutual TLS client verification, HSTS, CSP, CORS. API key and JWT authentication built in.

performance

Minimal allocations

Fixed-size buffer pools and stack-allocated parsing for HTTP/1.1. Lightweight allocators for H2 HPACK and QUIC state. No garbage collection.

ops

Observability

Prometheus metrics, OpenTelemetry traces, structured JSON logging. Health probes and admin API for runtime management.

ops

Hot reload

SIGHUP reloads routes and upstreams without dropping connections. Multi-worker with SO_REUSEPORT for zero-downtime deploys.

traffic

Rate limiting

Per-IP and per-consumer rate limiting. Request body validation with JSON Schema. Response caching with LRU eviction.

discovery

Service discovery

DNS and Consul service discovery for upstream resolution. Traffic mirroring for shadow testing production traffic.

Get started

Requires Zig 0.16.0 (stable) and OpenSSL 3.5+ for TLS/HTTP-2/HTTP-3.

# clone and build git clone https://github.com/justinGrosvenor/swerver.git cd swerver zig build -Doptimize=ReleaseFast -Denable-tls=true -Denable-http2=true -Denable-http3=true # run ./zig-out/bin/swerver --config config.json # or quick start (HTTP/1.1 only, no dependencies) zig build run

Native x402 payment protocol

swerver speaks x402 natively. Gate any endpoint behind pay-per-request USDC payments. No billing service, no API keys, no invoices. The protocol handles payment verification at the edge before traffic hits your upstream.

Monetize AI inference, data feeds, premium APIs. Anything with a URL. Pricing from $0.001 to $100 per request.

x402 platform →