Current setup: Node.js - 8.3.4 Socket.io - 2.0.4 Express - 4.15.4
I have recently run into an issue with running 2 concurrent instances of a middleware service that allows for socket.io connections. For traffic routing our company uses a combination of F5 and treafik, and I have been told that there is no way to guarantee a connection with the same server upon a new request. So when the front end connects to the middleware the first time, I get data from the socket connection. However, one refresh will likely cause several Session ID errors related to socket.io. This is because I am most likely being directed to the other server. I have been looking for a solution for this for a couple hours and this: https://www.npmjs.com/package/express-socket.io-session seems like a good possibility.
I feel like this is something that a lot of people have had to deal with. Can anyone give me their thoughts on what they have done to solve this issue? We currently use a Redis server to store user session data (auth related), I was thinking we could use it to store the Session IDs from socket.io then change the socket connection process to see if a session ID exists.
Thank you, Ryan