ws
8.23.0 · 12 Nov 2026MIT428.4M / weekRepositorynpmAtom feed
4.1.0 is the newest release of 4.x.
In short
8 breaking
- Breaking
The close status code is now set to 1005 if the received close frame contains no status code (a31b1f6).
- Breaking
Error messages and types have been updated (695c5ea).
- Breaking
The
onerrorevent handler now receives anErrorEventinstead of JavaScript error (63e275e). - Breaking
The third argument of
WebSocket.prototype.ping()andWebSocket.prototype.pong()is no longer a boolean but an optional callback (30c9f71). - Breaking
The non-standard
protocolVersionandbytesReceivedattributes have been removed (30c9f71...ee9b5f3). - Breaking
The
extensionsattribute is no longer an object but a string representing the extensions selected by the server (fdec524). - Breaking
The
'headers'event on the client has been renamed to'upgrade'. Listeners of this event now receive only theresponseargument (1c783c2). - Breaking
The
WebSocket.prototype.pause()andWebSocket.prototype.resume()methods have been removed to prevent the user from interfering with the state of the underlyingnet.Socketstream (a206e98).
Security
2 advisories affect 4.0.0; 5.2.5 fixes them
- Highws: Memory exhaustion DoS from tiny fragments and data chunksGHSA-96hv-2xvq-fx4p · 15 Jun 2026Fixed in 5.2.5
- Highws affected by a DoS when handling a request with many HTTP headersGHSA-3h5v-q93c-6h6q · 17 Jun 2024Fixed in 5.2.4
Release note
Breaking changes
- Breaking
The close status code is now set to 1005 if the received close frame contains
no status code (a31b1f6). - Breaking
Error messages and types have been updated (695c5ea).
- Breaking
The
onerrorevent handler now receives anErrorEventinstead of JavaScript
error (63e275e). - Breaking
The third argument of
WebSocket.prototype.ping()andWebSocket.prototype.pong()is no longer a boolean but an optional callback
(30c9f71). - Breaking
The non-standard
protocolVersionandbytesReceivedattributes have been
removed (30c9f71...ee9b5f3). - Breaking
The
extensionsattribute is no longer an object but a string representing
the extensions selected by the server (fdec524). - Breaking
The
'headers'event on the client has been renamed to'upgrade'. Listeners
of this event now receive only theresponseargument (1c783c2). - Breaking
The
WebSocket.prototype.pause()andWebSocket.prototype.resume()methods
have been removed to prevent the user from interfering with the state of the
underlyingnet.Socketstream (a206e98).
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.