WebRTC-Experiment
WebRTC-Experiment copied to clipboard
RTCMulticonnection/Scalable Broadcasting CORS error?
Anyone else run into this:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9001/socket.io/?userid=152c4qzg1dmjg1y8igw…imitPerUser=1&extra=%7B%7D&EIO=3&transport=polling&t=N8vEBNE. (Reason: CORS request did not succeed).
If I use connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/'; it works fine. So how to allow CORS for localhost:9001?
How to fix?
Thanks.
hi i have same problem how you resolve this
I am using haproxy and SSL so this may not work for you.
use letsencrypt for SSL and here is the config.json I use;
{ "socketURL": "/", "dirPath": "", "homePage": "index.html", "viewerPage": "viewer.html", "socketMessageEvent": "RTCMultiConnection-Message", "socketCustomEvent": "RTCMultiConnection-Custom-Message", "port": "9001", "enableLogs": "true", "autoRebootServerOnFailure": "false", "isUseHTTPs": "false", "sslKey": "fake-keys/privatekey.pem", "sslCert": "fake-keys/certificate.pem", "sslCabundle": "", "enableAdmin": "true", "adminUserName": "", "adminPassword": "", "broadcaster": "bcaster", "viewers": "viewer" }
Comment out the following line in .html file: // connection.socketURL =
hi i try your way, not work .
but i look the stackoverflow answer it's work for me
ioServer(httpApp)
change after
ioServer(httpApp,{ cors: true })
holp this can be help you