Skip to content
AtharsTech LogoAtharsTechdev

    Type to search...

    ↑↓ Navigate↵ Select
    RustNovember 20, 2026•2 min read

    Building an HTTP/2 & Rustls Edge Reverse Proxy with Cloudflare Pingora

    Building an HTTP/2 & Rustls Edge Reverse Proxy with Cloudflare Pingora

    Dynamic custom-domain routing for hosted applications demands an edge proxy that can reload routes in milliseconds without dropping active WebSocket or HTTP/2 streams. At AtharsTech, athars-proxy implements this control plane in pure Rust on top of Cloudflare Pingora.

    Why Pure-Rust TLS and ALPN H2H1

    Using Pingora with rustls eliminates C OpenSSL memory-safety pitfalls while enabling ALPN::H2H1 negotiation. Browsers multiplex concurrent API requests over HTTP/2 while upstream Node.js and Rust backends communicate seamlessly.

    • Lock-Free Route Lookups: Routes are stored in a concurrent DashMap keyed by normalized hostnames.
    • Instant Route Hydration: On startup, the proxy hydrates routes from Redis hash athars:routes and listens to PubSub channel athars:routes:events.
    • Fail-Closed Local IPC: Administrative mutations on loopback port 8099 require constant-time Bearer token verification.

    Symmetric SSRF Guards Across IPC and PubSub

    Every upstream target passed through either HTTP IPC or Redis PubSub undergoes identical validation:

    1. Hostnames are sanitized and checked against private or loopback bypass patterns.
    2. Reserved internal ports (such as local engine port 8088 or database ports) are rejected by FORBIDDEN_PORTS.
    3. Percent-decoded path inspection and bounded IP rate-limit caches mitigate abusive scans before requests reach upstreams.

    Learn more about our full stack on the Projects page or read about DirectAdmin and custom domain routing.