Hi
My situation is this:
I’m hosting two apps on heroku. One is my api for my vote app and the other is for the front end code for my vote app. The socket connection worked fine locally. but for some reason I can’t make the connection in production. This is the url to my client side code:
https://fierce-everglades-13309.herokuapp.com/ if you open the console you’ll see the error message I’m getting.
In my pollcontainer component, I’m trying to connect to my api like this:
const socket = io('https://tranquil-rocky-mountain-92476.herokuapp.com/')
As a result I’m getting this error
VM53:161 WebSocket connection to wss://tranquil-rocky-mountain-92476.herokuapp.com/socket.io/?EIO=3&transport=websocket&sid=5_PKISMeChdukMNZAAAG' failed: Error during WebSocket handshake: Unexpected response code: 400
WrappedWebSocket @ VM53:161
It seems like my server isn’t allowing a connection from my client. But I have no idea how to fix this. And I really have not been able to find a solution online for some reason. Can anybody help me understand why this isn’t working?