WebSocket error using Python, Flask, and Flask-SocketIO

Hey,
I am using Python, Flask, and Flask-SocketIO for my web application and I am using WebSocket messages
to make my user interfaces better. I am a new user for Render and I am evaluating it first before
purchasing a monthly subscription.

However, my WebSocket server is encountering issues connecting to my Render Websocket Server
and I am getting below errors.

Bad Request 400 WebSocket connection to ‘’ failed: WebSocket is closed before the connection is established.

'wss://my-web-app.onrender.com/socket.io/?EIO=4&transport=websocket&sid=MpztrjYDM6HeY81eAAAJ'

I have tested this locally (localhost) and it works with no issues by the way.

My Javascript uses plain SocketIO

// Establish a Socket.IO connection
var socket = io.connect();

// Listen for the 'eventTracking' event
socket.on("eventTracking", function (msg) {
    console.log(msg);
});

I have searched the forum for this but I am not able to make it work.

Anyone have clues? Thank you.

Any advise please how to activate WebSocket on Render?
Thanks

Has anyone done this thing? Or even Render support? I am considering purchasing a license for Render but cannot figure out how to make my application work.

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