ethand91 / mediasoup3-record-demo

Simple Record Demo using Mediasoup 3 and GStreamer
198 stars 93 forks source link

Websocket connection failing #60

Open kukirokuk opened 3 years ago

kukirokuk commented 3 years ago

I try to open localhost:8080 and there is websocket connection fail in chrome console: index.js:12 WebSocket connection to 'wss://localhost:3000/' failed The server is started and there is Socket Server listening on port 3000 message. I have changed websocket port, allowed unsecure connection in chrome site settings but nothing works. May be this is relevant, I have the same error when trying open official mediasoud demo page https://v3demo.mediasoup.org

thedeephakani commented 2 years ago

facing same issue.

ethand91 commented 2 years ago

Are you running a Firewall etc.?

thedeephakani commented 2 years ago

No, I am working on localhost and have no firewall restriction.

asubramania commented 11 months ago

Please fix the "cors" on the server side:

//const wss = new WebSocket.Server({ server: httpsServer }); const wss = new WebSocket.Server({ server: httpsServer, verifyClient: (info) => { const origin = info.origin; // Allow all origins for now, for debugging purposes: return true; // For production, you should check the origin, as shown previously. } });

Hope this helps!

anasmohammed361 commented 6 months ago

same issue with this, i've also added cors but the error seem to persist

anasmohammed361 commented 6 months ago

I switched my ws server to http and altered the url in the clien t, now it seems to work fine

sorokinvj commented 3 months ago

both Chrome and Safari was not happy with certificate, so refactoring it to use http instead of https helped