You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/api/WebSocket.md
-21Lines changed: 0 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ When passing an object as the second argument, the following options are availab
18
18
***protocols**`string | string[]` (optional) - Subprotocol(s) to request the server use.
19
19
***dispatcher**`Dispatcher` (optional) - A custom [`Dispatcher`](/docs/docs/api/Dispatcher.md) to use for the connection.
20
20
***headers**`HeadersInit` (optional) - Custom headers to include in the WebSocket handshake request.
21
-
***maxDecompressedMessageSize**`number` (optional) - Maximum allowed size in bytes for decompressed messages when using the `permessage-deflate` extension. **Default:**`4194304` (4 MB).
22
21
23
22
### Example:
24
23
@@ -43,26 +42,6 @@ import { WebSocket } from 'undici'
// Connection will be closed if a message exceeds the limit
60
-
console.error('WebSocket error:', event.error)
61
-
})
62
-
```
63
-
64
-
> ⚠️ **Security Note**: The `maxDecompressedMessageSize` option protects against memory exhaustion attacks where a malicious server sends a small compressed payload that decompresses to an extremely large size. If you increase this limit significantly above the default, ensure your application can handle the increased memory usage.
65
-
66
45
### Example with HTTP/2:
67
46
68
47
> ⚠️ Warning: WebSocket over HTTP/2 is experimental, it is likely to change in the future.
0 commit comments