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?
is it reasonable that we use one websocket port for multi kind of requests
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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).