When hosting my app locally, I have no issues with WebSockets.
However, when hosted on Fly, I get the following errors in the console:
WebSocket connection to ‘’ failed: WebSocket is closed before the connection is established.
Failed to load resource: the server responded with a status of 400
The issue is also very intermittent. I don’t always get these errors - sometimes they only happen after refreshing the page a few times.
Please can I get some assistance?
It only seems to happen when more than one instance is running. I assume it’s because I haven’t enabled sticky sessions. Any advice on how to do that for a NodeJS app hosted on Fly?