Skip to content

Discuss: passing in own http(s) server #20

@rikkertkoppes

Description

@rikkertkoppes

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions