-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: adding examples and a see link to Websockets jdocs #27957
base: main
Are you sure you want to change the base?
Conversation
* | ||
* ```ts | ||
* const ws = new WebSocket("ws://localhost:8080"); | ||
* console.log(ws.extensions); // "" | ||
* ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't very descriptive - you could give some examples of extensions that might be returned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no such thing as WebSocketServer
. The example doesn't need to be runnable - just looking for a description of what this is... something like
/**
* Returns the extensions selected by the server, if any.
*
* WebSocket extensions add optional features negotiated during the handshake via
* the `Sec-WebSocket-Extensions` header.
*
* At the time of writing, there are two registered extensions:
*
* - [`permessage-deflate`](https://www.rfc-editor.org/rfc/rfc7692.html): Enables per-message compression using DEFLATE.
* - [`bbf-usp-protocol`](https://usp.technology/): Used by the Broadband Forum's User Services Platform (USP).
*
* See the full list at [IANA WebSocket Extensions](https://www.iana.org/assignments/websocket/websocket.xml#extension-name).
*
* Example:
*
* ```ts
* const ws = new WebSocket("ws://localhost:8080");
* console.log(ws.extensions); // e.g., "permessage-deflate"
* ```
*/
readonly extensions: string;
adding examples to websockets interfaces and a see link