diff --git a/src/server.ts b/src/server.ts index 6affc746..bb2c0710 100644 --- a/src/server.ts +++ b/src/server.ts @@ -564,6 +564,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. */