NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #55 most downloaded on npm
Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
Latest stable
8.23.0
Last release today
12 Nov 2026
Release timing varies
gaps range from 8 days to 6 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
195 releases · first in 2011
Drag across the ruler to compare, or tap a release to open it.
Fixed an issue that caused a stack overflow when parsing a buffer with thousands of frames (#992).
Added support for bufferutil@2 and utf-8-validate@3 (466e210).
bufferutil@2 and utf-8-validate@3 (466e210).Fixed a bug that caused wrong frames to be created (d856dcb).
Your coding agent can read these notes before it upgrades. Set up the MCP server →
The following breaking changes only apply if you required the mentioned classes directly.
new operator is now required to create all instances as we moved to ES6
classes.clients property of the WebSocketServer is no longer an Array but a
Set and is only set if the clientTracking option is truthy (#806).WebSocketServers
when binding them to the same underlying HTTP/s server (#885).WebSocket.prototype.stream() and ability to pass a readable stream
to WebSocket.prototype.send() (#875).handleProtocols handler (#890).supports property from WebSocket (#918).WebSocket.createServer(), WebSocket.createConnection(), and
WebSocket.connect() factory functions (#926).WebSocket.prototype.ping() and
WebSocket.prototype.pong() is no longer an options object but a boolean
(#951).WebSocket.prototype.close() is called before the
connection is established (#956).The following breaking changes only apply if you required the mentioned classes directly.
Sender inheritance from EventEmitter (#861).BufferPool class (73ab370).extensions a required argument for the Receiver constructor (5f53194).receiver.onbinary and receiver.ontext have been merged into
receiver.onmessage (#939).WebSocketServer (#795).checkServerIdentity option to WebSocket (#701).threshold option for permessage-deflate to only compress messages
whose size is bigger than threshold (6b3904b).shouldHandle method to WebSocketServer to see if a request should
be accepted or rejected. This method can be overridden by the user if a
custom logic is desired (6472425).removeEventListener method to WebSocket (078e96a).family option to WebSocket (#962).error events are now emitted with a proper Error instance (#789).fin option of WebSocket.prototype.send() was
unconditionally set to true (ea50be7).zlib.flush() was called with a wrong flush level
(#733).WebSocketServer.prototype.close() is now invoked when the
close event is emitted by the underlying HTTP/s server (#892).connection event was emitted even if the client
closed the connection during the handshake process (04530ad).crypto.randomBytes() instead of
Math.random() (7253f06).clients
set (#955).WebSocket.prototype.close() now works as expected if called on the client
before the connection is established (#956).WebSocket.prototype.send() no longer mutates the options object (#968).bufferedAmount getter now takes into account the data queued in the
sender (#971).Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed a DoS vulnerability (f8fdcd4).
Removed istanbul coverage folder from npm package (fac50ac).
Added support for bufferutil@>1 and utf-8-validate@>2 (b4cf110).
bufferutil@>1 and utf-8-validate@>2 (b4cf110).The masking key is now generated using crypto.randomBytes() instead of Math.random() (#994).
crypto.randomBytes() instead of
Math.random() (#994).https://github.com/websockets/ws/compare/1.1.0...1.1.1
https://github.com/websockets/ws/compare/1.1.0...1.1.1
https://github.com/websockets/ws/compare/1.0.1...1.1.0
https://github.com/websockets/ws/compare/1.0.1...1.1.0
There has been vulnerability in the ping functionality of the ws module which allowed clients to allocate memory by simply sending a ping frame. The p…
There has been vulnerability in the ping functionality of the ws module which allowed clients to allocate memory by simply sending a ping frame. The ping functionality by default responds with a pong frame and the previously given payload of the ping frame. This is exactly what you expect, but internally we always transform all data that we need to send to a Buffer instance and this is where the problem was. We didn't do any checks for the type of data we were sending. With buffers in node when you allocate it when a number instead of a string it will allocate the amount of bytes.
var x = new Buffer(100);
// vs
var x = new Buffer('100');
This would allocate 100 bytes of memory in the first example and just 3 bytes with 100 as value in the second example. So when the server would receive a ping message of 1000 it would allocate 1000 bytes on the server and returned non-zeroed buffer to the client instead of the actual 100 message.
var ws = require('ws')
var server = new ws.Server({ port: 9000 })
var client = new ws('ws://localhost:9000')
client.on('open', function () {
console.log('open')
client.ping(50) // this makes the server return a non-zeroed buffer of 50 bytes
client.on('pong', function (data) {
console.log('got pong')
console.log(data) // a non-zeroed out allocated buffer returned from the server
})
})
As you can imagine that is pretty darn dangerous so we fixed it as soon as we received a heads up about this. So I would like to thank @feross and @mafintosh for discovering this vulnerability and disclosing it to me so it could be resolved asap.
Discontinued support for all node versions except for 0.12, 4.0 and 5.0. We should focus on the future and that will be Node 5 and ES6.
var WS = window.WebSocket || require('ws')So future.. Ideally I want to start rewriting parts of the library in ES6 and completely clean up the code base. Pull requests for this are encouraged and appreciated <3 as this takes a lot of time.
Nothing published for this version
Nothing published for this version
Nothing published for this version
The ws module have been plagued with build failures that was caused by it's optional compilation of binary add-ons. It used an installation hack inste
The ws module have been plagued with build failures that was caused by it's optional compilation of binary add-ons. It used an installation hack instead of using optionalDependencies for it. Now if optional dependencies work correctly.. There shouldn't be any more build failures because of the binary addon building failed.
And as you might have noticed, we moved the repository to a new organization: websockets this allows us to more easily onboard people, split up everything in to more tiny maintainable modules etc.
The 0.7 release ensures io.js compatibility by shipping with a new version of the NaN library which polyfills the differences between various of V8 an
The 0.7 release ensures io.js compatibility by shipping with a new version of the NaN library which polyfills the differences between various of V8 and Node.js APIs.
Another notable change is that way we've exported the binary parts of the module. They seem to have caused some build failures in the past and thanks to patches of @pjump they are now resolved.
0.7 Is also the first release without a HISTORY.md file as we're moving everything to Github's release feature.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.