diff --git a/src/server.ts b/src/server.ts index b5eaf075..3431d674 100644 --- a/src/server.ts +++ b/src/server.ts @@ -570,6 +570,20 @@ export class Server extends EventEmitter { return result; } + /** + * Forcibly close a specific pending proxy connection. + */ + closeConnection(connectionId: unknown): void { + this.log(null, 'Closing pending socket'); + + const socket = this.connections.get(connectionId); + if (!socket) return; + + socket.destroy(); + + this.log(null, `Destroyed pending socket`); + } + /** * Forcibly closes pending proxy connections. */