Socketio with Nodebalancer and ssl
This issue was discussed 9 years ago but:
I am using a node express server with socketio. The ssl certificates is installed on the nodebalancer but the socket connections does not work. Has anybody done this and if so what is the nodebalancer configurations to achieve this?
1 Reply
While I am not familiar with SocketIO specifically, this configuration should be possible based on my research. My best recommendation would be to use one of the known configurations listed here:
https://socket.io/docs/v3/using-multiple-nodes/index.html
I don't think this is an issue with the Nodebalancer configuration itself and is likely caused by issues with the SocketIO or SSL configuration. One thing you could try would be to switch the Nodebalancer protocol over to TCP
and test connectivity. More information on this configuration below:
How do I configure my NodeBalancer to pass through SSL connections to the back-end nodes?
If this still does not suit your needs, I would test running your own load balancing solution and configure it according to SocketIO's guidance:
Nginx:
Use NGINX as a Front-end Proxy and Software Load Balancer
https://socket.io/docs/v3/using-multiple-nodes/index.html#NginX-configuration
HAProxy:
How to Use HAProxy for Load Balancing
https://socket.io/docs/v3/using-multiple-nodes/index.html#HAProxy-configuration
One or both of these configurations should work for your use case. I hope this information helps! If you have further questions, please let us know.