Proof of Concept to show Heroku cannot handle sticky worker sessions with Node Cluster
This is a proof of concept application to prove that Heroku cannot handle socket.io polling transports while using Node clusters. (I thought it would not work, but turns our that it did work....)
The problem is that all the "sticky session" solutions have all of the workers using a random port on their server.listen(), and Heroku blocks all ports aside from process.env.PORT
.
The source code was originally built here: https://github.com/ANURAGVASI/socket.io-multiserver-chatApp Accompanying blog article: https://blog.imaginea.com/7597-2/
Summary of the issue:
WEB_CONCURRENCY
environment variable to 3
or higher to allow workers on any dyno size['polling']
to force the simulation of browsers or networks without websocket supportYou can run this locally to confirm it is working
npm run build
npm start