I am trying to setup websocket servers behind a load balancer. At first, I used the socket.io library. But I found that it requires sticky session
when used behind a load balancer.
According to this website, it sends multiple requests to perform handshake and establish a connection. If the requests are sent to different servers, the connection will fail.
After further study, i found that other websocket server library like SockJS also have the same problem. They all require sticky session to work behind a load balancer.
Now I am checking the websocket library ws. But I could not find any example of using it behind load balancer.
Does the ws
library requires sticky session to work?
Is there any other websocket library that can work without sticky session behind a load balancer?