[英]XMLHttpRequest Cross origin requests are only supported for protocol schemes in turn server
I am getting a below error in chrome console 我在Chrome控制台中收到以下错误
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.
XMLHttpRequest无法加载XMLHttpRequest无法加载turn:global.turn.twilio.com:3478 / turn?username = username&key = key&transport = udp仅协议方案支持跨源请求:http,数据,chrome,chrome扩展名,https。
while running a local webrtc sample server The node server example i am running is from https://github.com/ISBX/apprtc-node-server/ 当运行本地webrtc示例服务器时我正在运行的节点服务器示例来自https://github.com/ISBX/apprtc-node-server/
Below is the 下面是
screenshot
屏幕截图
Thanks in advance 提前致谢
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. 我相信您对TURN服务器的用途有误解,并且正在将其称为标准Web服务器。
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. 正如一些评论者提到的那样,您不应向使用不同TURN协议的TURN服务器发出HTTP请求。 Instead, you configure your WebRTC setup via the iceServer object, which is where you define a TURN server.
相反,您可以通过iceServer对象(定义TURN服务器)配置WebRTC设置。 The WebRTC implementation will use the TURN servers when required.
在需要时,WebRTC实现将使用TURN服务器。
Here's a nice article about WebRTC signaling: 这是一篇有关WebRTC信令的不错的文章:
https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ https://www.html5rocks.com/zh-CN/tutorials/webrtc/infrastructure/
And here's a couple other articles if you're interested in learning about the specific protocols WebRTC uses: 如果您想了解WebRTC使用的特定协议,这里还有其他几篇文章:
https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Protocols https://developer.mozilla.org/zh-CN/docs/Web/API/WebRTC_API/Protocols
https://www.twilio.com/docs/api/stun-turn/faq https://www.twilio.com/docs/api/stun-turn/faq
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.