import { Request, Response } from 'express'; import { WebSocket } from 'ws'; import { IncomingMessage } from 'http'; import type { Duplex } from 'stream'; interface ProxyPortConfig { port: number; enabled: boolean; label?: string; } interface ProxyConfig { enabled: boolean; ports: ProxyPortConfig[]; } export declare function updateProxyConfig(agentId: string, config: ProxyConfig): void; export declare function getProxyConfig(agentId: string): ProxyConfig | undefined; export declare function removeProxyConfig(agentId: string): void; /** * Returns true if the message was handled by the tunnel module (should NOT * be forwarded to web clients). */ export declare function handleAgentTunnelMessage(msg: Record): boolean; export declare function httpProxyHandler(req: Request, res: Response): void; /** * Returns true if the URL matches a proxy WebSocket path and was handled * (or rejected). Returns false if the URL is not a proxy path. */ export declare function handleTunnelWsUpgrade(req: IncomingMessage, socket: Duplex, head: Buffer, wss: { handleUpgrade: (req: IncomingMessage, socket: Duplex, head: Buffer, cb: (ws: WebSocket) => void) => void; }): boolean; export declare function cleanupAgentTunnels(agentId: string): void; export {};