u.jegan
u.jegan

Reputation: 833

XMLHttpRequest Cross origin requests are only supported for protocol schemes in turn server

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 enter image description herescreenshot

Thanks in advance

Upvotes: 8

Views: 887

Answers (1)

Michael Yang
Michael Yang

Reputation: 385

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

Upvotes: 1

Related Questions