Skip to content

Commit ee468e6

Browse files
authored
fix: prevent infinite loop with Node.js built-in WebSocket (#723)
This is a backport of socketio/socket.io@4865f2e Related: socketio/socket.io#5194
1 parent 50ed08a commit ee468e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/transports/websocket.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ WS.prototype.onClose = function () {
245245

246246
WS.prototype.doClose = function () {
247247
if (typeof this.ws !== 'undefined') {
248+
this.ws.onerror = () => {};
248249
this.ws.close();
249250
}
250251
};

0 commit comments

Comments
 (0)