I am developing a node.js application with Socket.io and deploying same on Heroku Dyno. Socket.io is using RedisStore with its PUB/SUB. Socket.io client works perfectly fine with one dyno in heroku. But when I increase the number of dyno to more than one (say two), socket io client request does not work.
Please let me know if any specific configuration on client side is needed while setting up heroku for multiple web dyno having socket.io support.
Sorry, but heroku doesn't support sticky session and it's not supported by Socket.io
Sticky load balancing If you plan to distribute the load of connections among different processes or machines, you have to make sure that requests associated with a particular session id connect to the process that originated them.
Using multiple nodes
There's a great thread in an issue on the engine.io github. Helped me understand the issue of sticky sessions, engine.io, and heroku a lot better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With