Skip to content

Commit

Permalink
fix(browser): force closing client doesn't destroy websocket correctly (
Browse files Browse the repository at this point in the history
#1820)

Fixes #1817
  • Loading branch information
robertsLando committed Mar 15, 2024
1 parent 78e9213 commit f9b1204
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/BufferedDuplex.ts
Expand Up @@ -77,6 +77,12 @@ export class BufferedDuplex extends Duplex {
this.proxy.end(callback)
}

_destroy(err: Error, callback: (error: Error) => void): void {
this.writeQueue = []
this.proxy.destroy(err)
callback(err)
}

/** Method to call when socket is ready to stop buffering writes */
socketReady() {
this.emit('connect')
Expand Down

0 comments on commit f9b1204

Please sign in to comment.