atproto relay in zig zlay.waow.tech
relay zig atproto

add connect gate to limit concurrent DNS/TLS handshakes master

shared semaphore (ConnectGate) bounds concurrent connection attempts across all subscriber threads, preventing the DNS/TLS storm at startup and during reconnect storms that starve the HTTP health probe. configurable via MAX_CONCURRENT_CONNECTS env var (default 50). each subscriber acquires a permit before connectAndRead() and releases it on return (success or failure) via defer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>