-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
Missing reference (and types) for response.socket.server #47148
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Affected URL(s)
https://nodejs.org/dist/latest-v18.x/docs/api/http.html#responsesocket
Description of the problem
There seems to have been a missing property in the API reference (and @types/node typings) regarding the
serverproperty of a ServerResponse instance.I have seen about it multiple times in articles or videos, for example to set up Socket.io in Next.js or a WebSocket module in Nuxt.
Here is a simple snippet that allows to access the
serverproperty:I don't know if that property is supposed not to be used or if it is just missing from the API references, but it seems like the common way to 'plug in' WebSocket servers onto frameworks that don't directly provide a way to do so.