Skip to content

[pull] master from websockets:master#141

Open
pull[bot] wants to merge 317 commits into
stackriot:masterfrom
websockets:master
Open

[pull] master from websockets:master#141
pull[bot] wants to merge 317 commits into
stackriot:masterfrom
websockets:master

Conversation

@pull

@pull pull Bot commented Oct 22, 2020

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Oct 22, 2020
@lpinca lpinca force-pushed the master branch 2 times, most recently from 13c5925 to 3d5066a Compare November 8, 2020 08:25
@lpinca lpinca force-pushed the master branch 3 times, most recently from f77215b to 114de9e Compare March 7, 2021 16:50
@lpinca lpinca force-pushed the master branch 2 times, most recently from 431cc3e to aca94c8 Compare July 3, 2021 08:15
lpinca added 8 commits July 14, 2021 21:26
Make the `WebSocket` constructor throw a `SyntaxError` if the URL
contains a fragment identifier or if the URL's protocol is not one of
`'ws:'`, `'wss:'`, or `'ws+unix:'`.
Avoid decoding text messages and close reasons to strings. Pass them as
`Buffer`s to the listeners of their respective events. Also, make
listeners of the `'message'` event take a boolean argument to speficy
whether or not the message is binary.

Refs: #1878
Refs: #1804
When `WebSocketServer.prototype.close()` is called, stop accepting new
connections but do not close the existing ones.

If the HTTP/S server was created internally, then close it and emit the
`'close'` event when it closes. Otherwise, if client tracking is
enabled, then emit the `'close'` event when the number of connections
goes down to zero. Otherwise, emit it in the next tick.

Refs: #1902
Match the behavior of Node.js core `net.Server` and call the callback
of `WebSocketServer.prototype.close()` with an error if the server is
already closed.
@lpinca lpinca force-pushed the master branch 2 times, most recently from 106cf84 to c4394c3 Compare July 20, 2021 11:33
lpinca added 7 commits July 29, 2021 07:10
Make `WebSocket.prototype.addEventListener()` a noop if the `type`
argument is not one of `'close'`, `'error'`, `'message'`, or `'open'`.
Make `WebSocket.prototype.removeEventListener()` only remove listeners
added with `WebSocket.prototype.addEventListener()` and only one at
time.
Prevent the `onclose`, `onerror`, `onmessage`, and `onopen` getters and
setters from returning or removing event listeners added with
`WebSocket.prototype.addEventListener()`.

Also prevent `WebSocket.prototype.removeEventListener()` from removing
event listeners added with the `onclose`, `onerror`, `onmessage`, and
`onopen` setters.

Refs: #1818
Make the `onclose`, `onerror`, `onmessage`, and `onopen` getters return
`null` instead of `undefined` if the event handler is not set.
- Remove non-standard `OpenEvent` class.
- Make properties read-only.
- Update constructor signatures to match the ones defined by the HTML
  standard.
lpinca and others added 5 commits December 2, 2025 14:08
lpinca added 12 commits January 9, 2026 13:10
To simplify the API before exporting the `PerMessageDeflate` class,
reduce the number of positional parameters in the constructor by moving
`isServer` and `maxPayload` into the options object.
Export the `PerMessageDeflate` class, the parser and serializer for the
`Sec-WebSocket-Extensions` header, and the parser for the
`Sec-WebSocket-Protocol` header.

Documentation is intentionally omitted as these utilities are primarily
intended for niche use cases rather than general consumption.

Refs: #2313
When the `reason` argument for `websocket.close()` is a `TypedArray`
instead of a string or `Buffer`, the function does not correctly
overwrite the dirty buffer allocated via `Buffer.allocUnsafe()`. This
results in the disclosure of uninitialized memory, potentially leaking
sensitive data to the remote peer.

Add stricter validation for the argument type.
Previously, the receiver could retain one `Buffer` entry per buffered
chunk or message fragment until enough data was parsed or the message
completed. A peer could use many tiny fragments/chunks and make retained
memory scale with retained part count rather than message payload size.

Add configurable `maxBufferedChunks` and `maxFragments` options to bound
the number of retained parts. When either limit is exceeded, emit
a `WS_ERR_TOO_MANY_BUFFERED_PARTS` error and close the connection with
close code 1008.

Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
Ensure that empty fragments are counted against the `maxFragments`
limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.