aeronet
Documentation: sjanel.github.io/aeronet

Why aeronet?
aeronet is a modern, fast, modular and ergonomic HTTP / WebSocket C++ client & server library for Linux, macOS and Windows focused on predictable performance, explicit control and minimal dependencies.
- Fast & predictable: edge‑triggered reactor model, zero/low‑allocation hot paths and minimal copies, horizontal scaling with port reuse. In CI benchmarks
aeronet ranks among the fastest tested implementations across multiple realistic scenarios.
- Modular & opt‑in: enable only the features you need at compile time to minimize binary size and dependencies.
- Ergonomic: easy API, automatic features (encoding, telemetry), RAII listener setup with sync / async server lifetime control, developer friendly with no hidden global state, no macros.
- Configurable: extensive dynamic configuration with reasonable defaults, per path options and middleware helpers, run-time router / config updates.
- Standards compliant: HTTP/1.1, HTTP/2, WebSocket, Compression, Streaming, Trailers, TLS, CORS, Range & Conditional Requests, Static files, URL Decoding, multipart/form-data, etc.
- Batteries included: beyond the server, a matching HTTP client and a JWT (JWS) module for signing/verifying tokens - same opt‑in, zero‑extra‑dependency design (both reuse the server’s own transport / TLS / crypto bricks).
- Reads JavaScript pages, no browser needed:
WebClient runs page scripts (QuickJS-ng) over a DOM (lexbor), with cookies, fetch, ES modules and timers, so waiting rooms and React apps read like any page (experimental, fully optional).
- Cloud native: Built-in Kubernetes-style health probes, opentelemetry support (metrics, tracing) with built-in spans and metrics, dogstatsd support, perfect for micro-services.
- Cross‑platform: primary platform is Linux (epoll); macOS (kqueue) and Windows (WSAPoll) are supported with a portable abstraction layer. Some Linux‑specific optimizations (kTLS,
MSG_ZEROCOPY, sendfile) are automatically disabled on other platforms.
aeronet is designed to be very fast, optimized for Linux. In our automated wrk-based benchmarks (HTTP/1.1), h2load-based benchmarks (HTTP/2), and k6-based benchmarks (WebSocket) against other popular frameworks (run in CI against a fixed set of competitors such as drogon, pistache, Crow, a Rust Axum server, Undertow in Java, Go and Python), aeronet:
- Achieves the highest requests/sec in most scenarios
- Consistently delivers lower average latency in those same scenarios
- Maintains competitive or better throughput and memory usage
You can inspect the latest benchmark tables generated on main from the CI benchmarks job and detailed methodology here:
You can browse the latest rendered benchmark tables directly on GitHub Pages:
Minimal Example
Spin up a basic HTTP server that responds on /hello in just a few lines.
All code examples in the README and the documentation pages are guaranteed to compile as they are covered by a CI check.
#include <aeronet/aeronet.hpp> // unique 'umbrella' header of the core public API
using namespace aeronet;
int main() {
Router router;
router.setPath(http::Method::GET, "/hello", [](const HttpRequestView& req) {
return req.makeResponse().header("x-req-body", req.body()).body("hello from aeronet\n");
});
HttpServer server(HttpServerConfig{}, std::move(router)); // default port is ephemeral, OS will pick an available one
server.run(); // blocking. Use start() for non-blocking
}
See the full program.
Streaming responses, coroutine (async) handlers, routing, middleware and the rest are covered in the documentation: start with Your first server, then Routing, Streaming responses and Async handlers.
Quick Start with provided examples
Minimal server examples for typical use cases (multi-threaded server, TLS, HTTP/2, WebSocket server and client, static files, sendfile, HTTP client, JavaScript pages, …) are provided in the examples directory.
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build --target aeronet-server-minimal
./build/examples/aeronet-server-minimal 8080 # or omit 8080 for ephemeral
Test with curl:
curl -i http://localhost:8080/hello
HTTP/1.1 200
date: Tue, 27 Oct 2026 06:35:01 GMT
server: aeronet
content-type: text/plain
content-length: 347
Hello from aeronet minimal server! You requested /hello
Features
| Area |
Highlights |
Documentation |
| HTTP/1.1 server |
Keep-alive, pipelining, chunked bodies, trailers, limits, streaming, duplicate header policy |
Servers and lifecycle, conformance |
| Routing & requests |
Path parameters, wildcards, route groups, per-route options, query / forms / multipart |
Routing, Requests, Responses |
| Middleware |
Global + per-route hooks, rate limiting (in-memory / Redis), CORS |
Middleware, CORS |
| Compression |
gzip / deflate / zstd / brotli, outbound negotiation and inbound decompression |
Compression |
| Static files |
sendfile, range and conditional requests |
Static files |
| Async handlers |
Coroutines (RequestTask), background work off the event loop |
Async handlers |
| TLS (flag) |
ALPN, mTLS, SNI, tickets, OCSP stapling, CRLs, kTLS, HTTP to HTTPS redirect |
TLS |
| HTTP/2 (flag) |
RFC 9113, HPACK, ALPN h2, h2c, multiplexing |
HTTP/2 |
| WebSocket (flag) |
RFC 6455, permessage-deflate, ping/pong, close handshake, server endpoints and client |
WebSocket, WebSocket client |
| HTTP client (flag) |
HTTP/1.1 + HTTP/2, keep-alive pool, redirects, proxy, streamed bodies, auto (de)compression |
HTTP client |
| JWT (flag) |
RFC 7519 JWS sign / verify, JWK / JWKS, rejects alg:none |
JWT |
| Protocol Buffers (flag) |
Binary and ProtoJSON bodies (RFC 9996) for the server and the client, compressed like any body |
Protocol Buffers |
| HTML parsing (flag) |
WHATWG HTML parser (lexbor), CSS selector queries, encoding sniffing, JSON state embedded by scripts |
HTML parsing |
| JavaScript pages (flag) |
WebClient (experimental): pages loaded with their scripts (QuickJS-ng), DOM bindings, fetch / XHR with CORS, ES modules, virtual-clock timers, script navigations, cookies and storage |
JavaScript pages |
| Observability |
OpenTelemetry (experimental), DogStatsD, logging, metrics callback |
Observability |
| Operations |
Kubernetes-style probes, graceful drain, signal handling, runtime config / router updates, JSON / YAML configuration |
Health probes, Kubernetes examples, JSON and config files |
| Performance |
Edge-triggered reactor, SO_REUSEPORT scaling, writev, MSG_ZEROCOPY |
Performance and tuning |
The complete list is in the feature overview. Every feature marked flag is opt-in at compile time, see the build configuration reference. Runtime options are listed in the server and client configuration references.
| Platform |
Status |
I/O backend |
| Linux (x86_64, aarch64) |
Full support (primary; tested on Ubuntu and Alpine in CI) |
epoll (edge-triggered) |
| macOS (Apple Silicon / x86_64) |
Supported |
kqueue |
| Windows (x64, MSVC) |
Supported |
WSAPoll |
Linux-specific optimizations (kTLS, sendfile, MSG_ZEROCOPY, eventfd / timerfd, DogStatsD over Unix sockets) are automatically disabled on other platforms.
64-bit targets only: 32-bit targets (i386, armv7…) are not supported and fail at configure time, see Installation and build.
Build & Installation
Full build, install, package manager (Conan, vcpkg), find_package / FetchContent and C++ modules instructions live in docs/getting-started/install.md.
Documentation
The full documentation, with search and navigation, is at sjanel.github.io/aeronet; its sources are in docs. See also the changelog and the roadmap.
Acknowledgements
Compression libraries (zlib, zlib-ng, zstd, brotli), OpenSSL, Opentelemetry, spdlog, lexbor and QuickJS-ng provide the optional feature foundation; thanks to their maintainers & contributors.
This project also includes code from the following open source projects:
License
Licensed under the MIT License. See LICENSE.
评论