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
I’m not sure if this is a bug or intended behavior. Either the code or the documentation needs to be corrected.
ws version
8.11.0
Node.js Version
19.1.0
System
No response
Expected result
The WebSocketServer constructor’s callback argument being added as a listener for the "listening" event on the given HTTP(S) server if (options.port === null && options.server).
Actual result
The expected not happening.
Attachments
No response
The text was updated successfully, but these errors were encountered:
issuefiler
changed the title
The callback listener is not added to the server.
The callback listener is not added to the options.server.
Nov 25, 2022
Is there an existing issue for this?
Description
The
callback
argument of theWebSocketServer
constructor is not “added as a listener for the"listening"
event on the HTTP server when not operating innoServer
mode,” if theserver
option, a pre-created Node.js HTTP/S server, is supplied, which is different than the current documentation.ws/doc/ws.md
Lines 72 to 95 in afd8c62
ws/doc/ws.md
Lines 173 to 174 in afd8c62
This is because the
callback
argument is only usedif (options.port != null)
.ws/lib/websocket-server.js
Lines 87 to 117 in afd8c62
I’m not sure if this is a bug or intended behavior. Either the code or the documentation needs to be corrected.
ws version
8.11.0
Node.js Version
19.1.0
System
No response
Expected result
The
WebSocketServer
constructor’scallback
argument being added as a listener for the"listening"
event on the given HTTP(S) serverif (options.port === null && options.server)
.Actual result
The expected not happening.
Attachments
No response
The text was updated successfully, but these errors were encountered: