import { type IncomingMessage, type ServerResponse } from "node:http"; import type { Duplex } from "node:stream"; /** * onOriginError is where the creator's dev server being down is ACTUALLY * OBSERVED. * * The tunnel client's own `onOriginError` fires on a socket error, and it never * sees one: this proxy sits between the two and answers a refused connection * with its own clean 502, so the client reads a perfectly valid HTTP response. * The 502 advisory — the most common failure in the whole feature — was * unreachable until the hook moved here. Found by killing a real dev server * under a live preview, not by reading the code. */ export declare function proxyWeb(req: IncomingMessage, res: ServerResponse, targetPort: number, onOriginError?: () => void): void; export declare function proxyWs(req: IncomingMessage, socket: Duplex, head: Buffer, targetPort: number): void;