import type { Server as HttpServer } from 'http'; /** Default path for the NATS WebSocket proxy endpoint. */ export declare const NATS_WS_PROXY_PATH = "/nats-ws"; /** * Derive the public NATS WebSocket URL from an HTTP request's headers. * * Respects `X-Forwarded-Proto` and `X-Forwarded-Host` so the correct * `wss://` scheme is used behind TLS-terminating load balancers. */ export declare function deriveWsUrlFromRequest(req: { headers: Record; }, basePath?: string): string; /** * Attach a WebSocket proxy to an HTTP server that bridges browser * connections to an internal NATS WebSocket endpoint. * * The browser connects to `wss://domain.com{basePath}/nats-ws` (port 443, * through an ALB or reverse proxy). This handler upgrades the connection * and bridges bidirectionally to the internal NATS WS target. * * The proxy auto-derives the public `wsUrl` from the first incoming * request's headers, respecting `X-Forwarded-Proto` and `X-Forwarded-Host` * so the correct `wss://` scheme is used behind TLS-terminating load balancers. */ export declare function attachNatsWsProxy(server: HttpServer, target: string, options?: { basePath?: string; onWsUrlDerived?: (url: string) => void; }): void;