Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

thisisjofrank
Copy link
Contributor

adding examples to websockets interfaces and a see link

@philhawksworth philhawksworth changed the title adding examples and a see link docs: adding examples and a see link to Websockets jdocs Feb 4, 2025
Comment on lines 83 to 87
*
* ```ts
* const ws = new WebSocket("ws://localhost:8080");
* console.log(ws.extensions); // ""
* ```
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Member

@ry ry Feb 6, 2025

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants