Express and React app: WebSockets Error

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?

UPDATE:

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?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.