I am getting a below error in chrome console
XMLHttpRequest cannot load XMLHttpRequest cannot load turn:global.turn.twilio.com:3478/turn?username=username&key=key&transport=udp Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
while running a local webrtc sample server The node server example i am running is from https://github.com/ISBX/apprtc-node-server/
Below is the screenshot
Thanks in advance
xml.html: 27 Access to XMLHttpRequest at 'file:///C:/Users/1819092/Desktop/MANAS/ajax_info.txt' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. If you have a question then use the red "Ask a Question" link at the top of the page.
When performing cross-origin requests on behalf of a content script, be careful to guard against malicious web pages that might try to impersonate a content script. In particular, do not allow content scripts to request an arbitrary URL.
The origin is a URL indicating the server from which the request initiated. It does not include any path information, but only the server name. The origin value can be null. Note that in any access control request, the Origin header is always sent.
Content scripts initiate requests on behalf of the web origin that the content script has been injected into and therefore content scripts are also subject to the same origin policy. (Content scripts have been subject to CORB since Chrome 73 and CORS since Chrome 83 .)
I believe you have a misunderstanding of what a TURN server is for, and are calling it as if it is a standard web server.
As some of the commenters mentioned, you're not supposed to make an HTTP request to a TURN server, which uses a different TURN protocol. Instead, you configure your WebRTC setup via the iceServer object, which is where you define a TURN server. The WebRTC implementation will use the TURN servers when required.
Here's a nice article about WebRTC signaling:
https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/
And here's a couple other articles if you're interested in learning about the specific protocols WebRTC uses:
https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Protocols
https://www.twilio.com/docs/api/stun-turn/faq
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With