Skip to content

Commit

Permalink
feat: closeConnection by id (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkosm authored May 2, 2022
1 parent b805251 commit b5b11af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit b5b11af

Please sign in to comment.