import { WebSocket } from 'ws'; class TunnelRegistry { private sockets = new Map(); register( tunnelId: string, ws: WebSocket ): void { this.sockets.set( tunnelId, ws ); } unregister( tunnelId: string ): void { this.sockets.delete( tunnelId ); } get( tunnelId: string ): WebSocket | undefined { return this.sockets.get( tunnelId ); } isActive( tunnelId: string ): boolean { return this.sockets.has( tunnelId ); } } export const registry = new TunnelRegistry();