unstale

npm / ws

ws

What changed in ws 6 to 8, from its official release notes, upgrade guides and advisories. Also covers @types/ws. Sources checked 2026-11-28.

26 breaking3 security8 new APIs and options3 behavior and defaults6 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

ws 835 changes

Breaking changes 17

  • The userinfo of the URL is now percent-decoded.

    8.22.2release notes

  • The server now rejects offers whose client_max_window_bits is smaller than configured clientMaxWindowBits.

    8.21.3release notes

  • The default value of maxFragments has been reduced.

    8.21.1release notes

  • Close reasons are passed to event listeners as Buffers instead of decoded strings.

    8.0.0release notes

  • The hook's protocols argument is now a Set instead of an Array.

    8.0.0release notes

  • Message listeners now receive data as a Buffer and take a boolean argument indicating whether the message is binary.

    8.0.0release notes

  • Support for Node.js versions earlier than 10.0.0 has been dropped.

    8.0.0release notes

  • The onclose, onerror, onmessage, and onopen properties are now null when their respective event handlers are unset.

    8.0.0release notes

  • The OpenEvent class has been removed.

    8.0.0release notes

  • The opening handshake is aborted if this header field value is empty or begins or ends with white space.

    8.0.0release notes

  • The server aborts the opening handshake when this header field value is invalid.

    8.0.0release notes

  • The constructor throws a SyntaxError when subprotocol names are invalid or duplicated.

    8.0.0release notes

  • Listeners registered through handler properties are now independent from listeners registered with addEventListener.

    8.0.0release notes

  • The method removes only listeners added with addEventListener, and removes only one at a time.

    8.0.0release notes

  • The constructor throws a SyntaxError if the connection URL contains a fragment identifier or uses a protocol other than ws:, wss:, or ws+unix:.

    8.0.0release notes

  • Calling close no longer closes existing connections; applications must close them manually if needed.

    8.0.0release notes

  • The callback receives an error if the server is already closed.

    8.0.0release notes

Security 3

  • Fixed a vulnerability where a malicious peer could force buffering of automatically sent Pong frames until memory was exhausted.

    8.23.0release notes

  • Fixed a vulnerability where tiny fragments and data chunks could crash a ws server or client due to OOM.

    5.2.5 … 8.21.0release notessecurity advisory

  • Prevents uninitialized memory disclosure when an unsupported TypedArray is passed as the reason argument.

    8.20.1release notessecurity advisory

New APIs and options 7

  • Introduced maxPendingAutoPong.

    8.23.0release notes

  • Introduced the protocols option.

    8.22.0release notes

  • Introduced maxBufferedChunks to configure buffering limits.

    8.21.0release notes

  • Introduced maxFragments to configure fragment limits.

    8.21.0release notes

  • The PerMessageDeflate class is now exported for developer use.

    8.20.0release notes

  • Utilities for the Sec-WebSocket-Extensions header are now exported.

    8.20.0release notes

  • Added the closeTimeout option.

    8.19.0release notes

Behavior and default changes 3

  • The default value of maxBufferedChunks has been reduced.

    8.21.1release notes

  • The package now uses an ES module wrapper.

    8.0.0release notes

  • The method is a noop when type is not close, error, message, or open.

    8.0.0release notes

Fixes and other changes 5

  • The constructor no longer mutates http: or https: url.URL objects.

    8.22.2release notes

  • The path of IPC URLs is no longer truncated at a colon.

    8.22.1release notes

  • Sender.frame() no longer returns empty chunks.

    8.22.1release notes

  • Invalid arguments no longer transition the state to WebSocket.CLOSING.

    8.22.0release notes

  • Handled a forthcoming breaking change in Node.js core.

    8.19.0release notes

ws 76 changes

Breaking changes 5

  • Support for Node.js 6 was dropped.

    7.0.0release notes

  • The constructor no longer supports url.Url instances.

    7.0.0release notes

  • When readyState is CONNECTING, an exception is thrown; when it is CLOSING or CLOSED, bufferedAmount increases by the data length in bytes, the callback receives an error if provided, and no exception is thrown if it is omitted.

    7.0.0release notes

  • When readyState is CONNECTING, an exception is thrown; when it is CLOSING or CLOSED, bufferedAmount increases by the data length in bytes, the callback receives an error if provided, and no exception is thrown if it is omitted.

    7.0.0release notes

  • When readyState is CONNECTING, an exception is thrown; when it is CLOSING or CLOSED, bufferedAmount increases by the data length in bytes, the callback receives an error if provided, and no exception is thrown if it is omitted.

    7.0.0release notes

Fixes and other changes 1

ws 65 changes

Breaking changes 4

  • A shim throws an error when the package is used after being bundled for the browser.

    6.0.0release notes

  • Support for the level option was dropped; use zlibDeflateOptions instead.

    6.0.0release notes

  • Support for the memLevel option was dropped; use zlibDeflateOptions instead.

    6.0.0release notes

  • Support for Node.js 4 was dropped.

    6.0.0release notes

New APIs and options 1

  • Added a client option for the maximum payload size, defaulting to 100 MiB.

    6.0.0release notes