To enable running a websocket server on an already existing http(s) server (like an express server), consider passing in an optional server instance
I would propose allowing a server instance in WSServerOptions
export interface WSServerOptions extends TlsOptions {
type: "websocket";
port?: number; // default 13900 (ws) or 13901 (wss)
server?: http.Server | https.Server; //optional server to pass in
}
And using that in startWebSocketServer or creating one if not given
This allows running http and ws over the same port as the rest of the application
Thoughts?
To enable running a websocket server on an already existing http(s) server (like an express server), consider passing in an optional server instance
I would propose allowing a server instance in
WSServerOptionsAnd using that in
startWebSocketServeror creating one if not givenThis allows running http and ws over the same port as the rest of the application
Thoughts?