/** * In-memory, per-IP connection-*attempt* rate limiter for the TCP server. Complements * MAX_CONNECTIONS_PER_IP (enforced in ConnectionManager), which only bounds *concurrent* * connections from one IP - it does nothing to stop an attacker who stays under that cap * while hammering the server with rapid connect-then-drop churn, since each attempt still * costs a TCP handshake and an accept()/reject() cycle regardless of whether the connection * itself is ultimately accepted. * * Same true-sliding-window + cooldown design as LoginRateLimiter.service.ts, applied to * connection attempts instead of failed logins. In-memory only, reset on process restart. */ declare class ConnectionRateLimiter { private static instance; private readonly attempts; private sweepIntervalHandle; static getInstance(): ConnectionRateLimiter; /** Milliseconds remaining before this IP may open a new connection, or 0 if it's clear. */ getCooldownRemaining(ip: string): number; /** * Records a new connection attempt, locking the IP out of further connections once the * threshold is crossed. Call once per accepted socket, regardless of whether the * connection is ultimately allowed through or rejected by the concurrent-connection cap. */ recordAttempt(ip: string): void; startCleanupSweep(): void; stopCleanupSweep(): void; /** Test/shutdown helper - clears every tracked IP's attempt counter and any active lockouts. */ clearAll(): void; } declare const _default: ConnectionRateLimiter; export default _default;