import type { IncomingMessage } from "node:http";
import type { Duplex } from "node:stream";
/**
 * Returns true if the upgrade request's Origin header should be allowed
 * (loopback / missing). Returns false to indicate the upgrade must be
 * rejected. Caller is responsible for `socket.destroy()` + logging.
 */
export declare function isOriginAllowed(req: IncomingMessage): boolean;
/**
 * Convenience wrapper: enforce the origin policy and tear down the
 * socket if it fails. Returns true when the request passed the check
 * (caller proceeds with the upgrade); false when the socket was
 * destroyed (caller should abort).
 */
export declare function enforceLoopbackOrigin(req: IncomingMessage, socket: Duplex, context: string): boolean;
//# sourceMappingURL=ws-origin.d.ts.map