Ahmad Faiyaz
1 min readJun 30, 2020

--

Hello good question. Websocket connection is persistent connection, once a connection is opened it will stay that way until the server/client closes the connection. And when you use http then webscocket transport protocol on socket.io, you need sessionAffinity as socket.io stores some information (seesion data I presume) on the server which promotes the connection, thus http request then ws connection should go to the same server. If you use websocket transport only, you don’t need to go to same server. If ws connection is closed we can create ws connection in another server as we are not storing any specific data (session) on the server. Let me know if this answers your question.

--

--

Ahmad Faiyaz
Ahmad Faiyaz

Responses (1)