YamaCasis
YamaCasis

Reputation: 1

is it reasonable that we use one websocket port for multi kind of requests?

is it reasonable that we use one websocket port for multi kind of requests when there is many users online in socket?
what about this in security and performance?

Upvotes: 0

Views: 541

Answers (1)

kanaka
kanaka

Reputation: 73091

If your server is properly multi-threaded or multi-process then there is no performance difference between running on one or many ports. In addition, even when your socket server (Websocket or not) is answering on a single port, the actual communication happens on a different server port for every connection.

For compatibility with existing web infrastructure it is likely you will want to run your WebSocket server on standard HTTP ports (80 and 443) so this already implies multiple clients connecting to one port (and probably using a web server that handles or can proxy WebSocket connections).

The security of your WebSocket server application is going to have far more to do with how your application is designed than with whether you run it using multiple listen ports or just one.

There are some WebSocket specific security considerations but for the most part the same security issues and best practices apply to WebSocket servers as to HTTP servers (or really any TCP service for that matter).

Upvotes: 2

Related Questions