Socket.io client is not connecting (socket backend on another server)

I have frontend on Netlify and my socket.io backend on another server. The problem is that when socket.io creates a polling request the connection is not made (status: (blocked:mixed-content)). When I’m manually trying GET from browser http://domain:port/socket.io/?EIO=3&transport=polling then I get a response. And when I’m testing with socket.io tools eg. Firecamp I’m also able to connect.

Is this something specific to netlify that socket.io connection is not allowed or this is still a thing on my end?

Thanks!

That was a problem with HTTP. Added SSL and now works.

1 Like

Thanks for sharing the solution, @chanar.

@chanar You can use rejectUnauthorized: false to allow connection even if you use https. This option simply bypass the SSL authentication.


const socket = io( "https://socketio-tweet-stream.herokuapp.com", {
  "rejectUnauthorized" : false
});

In Firecamp, you can find this option under config tab.

1 Like