Apache HTTP, rebuilt in Rust and WebAssembly.
A complete, zero-dependency Rust and WebAssembly port of the Apache HTTP Server — parsing real httpd.conf, outperforming Apache 2.4.67 by 3.4–4.9×, and mathematically verified by LeanRust & Lean 4.35.0.
sorry
#![forbid(unsafe_code)] · 129 KB WASM
Faster than NGINX 1.31.8, Apache 2.4.67, Caddy 2.11.9 & Node.js 24
Apples-to-apples native ARM64 benchmark on Apple M1 Max (10-core) serving this exact hottubhttp.org site with identical KeepAlive, 3 mod_headers security headers, GZIP compression, and access logs disabled. Zero failed requests across all 40 runs. Download full 4-page Benchmark Report (PDF) →
GET / (16.5 KB, 64 conns)
1.18× NGINX · 4.40× Apache
GET / (HTTP/1.1, 64 conns)
5.50× NGINX · 8.16× Apache
/robots.txt (67 B, 64 conns)
1.13× NGINX · 4.06× Apache
writev
8.34 GB/s · 1.16× NGINX
| Workload | HottubHTTP 0.1.0 | NGINX 1.31.8 | Apache 2.4.67 | Caddy 2.11.9 | Node.js 24 |
|---|---|---|---|---|---|
MT 64-conn Keep-Alive — /robots.txt (67 B) | 111,862 req/s | 99,004 req/s | 27,566 req/s | 23,956 req/s | 32,211 req/s |
MT 64-conn Keep-Alive — / HTML (16.5 KB) | 100,656 req/s | 85,471 req/s | 22,857 req/s | 21,216 req/s | 25,146 req/s |
MT 64-conn Keep-Alive — / GZIP (HTTP/1.1) | 106,277 req/s | 19,335 req/s | 13,026 req/s | 16,982 req/s | 10,636 req/s |
ApacheBench ab -k -n 40k -c 64 — Tiny 67 B (p99) | 61,505 (3 ms) | 44,680 (9 ms) | 13,082 (38 ms) | 17,285 (26 ms) | 20,685 (34 ms) |
ApacheBench ab -n 10k -c 32 — No-KA Churn (p99) | 25,983 (2 ms) | 17,410 (11 ms) | 13,453 (9 ms) | 15,616 (7 ms) | 7,384 (28 ms) |
| Binary / Runtime Footprint | 701 KiB | 1.42 MiB | 2.49 MiB + .so | 46.8 MiB | 59.1 MiB |
Apache HTTP semantics, zero C memory hazards
The live console above is the real Rust engine compiled to a 129 KB gzipped WebAssembly module. The exact same crate serves native multi-worker traffic on AWS Graviton — including this website at hottubhttp.org.
Real httpd.conf & 11-phase modular pipeline
Drop in Apache-style <VirtualHost>, <Directory>, <Location>, <FilesMatch>, <IfModule>, .htaccess, RewriteRule, RedirectPermanent, Header always set, Require valid-user, ProxyPass, mod_deflate, mod_autoindex, and mod_status.
Plus mod_wasm: plug sandboxed WebAssembly handlers directly into Apache's handler phase with zero C ABI risk.
<VirtualHost *:8080>
ServerName hottubhttp.org
DocumentRoot "/srv/www"
Header always set X-Content-Type-Options "nosniff"
RewriteEngine On
RewriteRule ^/legacy/(.*)$ /docs/$1 [R=301,L]
<Location "/_wasm/health">
WasmHandler health
Require all granted
</Location>
</VirtualHost>
Mathematically proved security boundaries
Instead of hoping a regression test catches the next CVE-2021-41773 traversal or CL+TE request smuggling bypass, HottubHTTP extracts its core decision kernels to Lean 4.35.0 via LeanRust.
Every request runs through kernel-certified functions with fingerprint fnv1a64:df3461b7e0fb430e: 12 functional specs, 5 Confidentiality & Integrity Noninterference proofs, and 10 standalone Lean 4 algebraic & Curry–Howard → False impossibility theorems.
#[unhackable]
#[ensures("has_cl == true && has_te == true
-> result.status == 400 && result.allow_body == false")]
#[ensures("cl_conflict == true
-> result.status == 400 && result.allow_body == false")]
#[ensures("result.allow_body == true
-> body_len <= old(pol.max_body_bytes)")]
#[input(pol, trusted)]
pub fn framing_policy_check(
mut pol: FramingPolicy, ...
) -> FramingPolicy
Zero-allocation hot path, never types & 0 external crates
hottubhttp-core and hottubhttp-server compile with #![forbid(unsafe_code)] and 0 third-party crates — featuring a stack-allocated SWAR HTTP/1.1 parser, bounded zero-copy CachingVfs, single-syscall writev scatter-gather I/O, and Rust's never type (! / Infallible) for panic-free infallible elimination and diverging worker loops.
Compiles identically to native ARM64/x86_64 binaries (hottubhttpd), browser WebAssembly (wasm32-unknown-unknown), and server/edge WASI (wasm32-wasip1).
hottubhttpd -t -f conf/httpd.conf # Syntax OK
hottubhttpd -S -f conf/httpd.conf # VirtualHost table
hottubhttpd -M # 18 static modules
hottubhttpd --proof # 27 Lean 4.35.0 proofs
hottubhttpd --license # Apache-2.0 + NOTICE
hottubhttpd --bench # Micro-benchmarks
What the Lean 4.35.0 kernel proves
Certificate fingerprint fnv1a64:df3461b7e0fb430e · 27 machine-checked theorems with zero sorry. Re-verify locally in seconds with cargo xtask prove.
- Functional + Noninterferencepath_step + path_access_allowedSticky DocumentRoot escape detection (CVE-2021-41773) + secret root ID noninterference.
- Bounded u8 + Noninterferenceuri_byte_safe (u8)Unconditionally rejects NUL, CR, LF, control bytes, DEL, and backslash with noninterference.
- RFC 9112 §6.3 + Falseframing_policy_check (u16)CL+TE and conflicting Content-Length always return HTTP 400 and never admit a body.
- Compound Guardchunk_budget_stepCompound arithmetic bound proving streaming chunked bodies never exceed
LimitRequestBody. - Access Controlauthz_evaluate
Require all deniednever grants; unauthenticated callers never passvalid-user. - Confidentiality + Integritypublic_status_active_workersNoninterference isolates TLS & HMAC keys from public
/server-statustelemetry. - MPM Pool Boundsmpm_acquire + mpm_release
MaxRequestWorkerspool never exceeds cap and never underflows below zero. - Anti-Range DoSrange_window_validateAnti-CVE-2011-3192: strictly enforces
MaxRangesand0 ≤ start ≤ end < len. - Inductive O(n)keepalive_step + header_overhead_budgetBounded Keep-Alive lifecycle + inductive
O(n)linear header accounting proof.