简体   繁体   English

XMLHttpRequest仅服务器的协议方案支持跨源请求

[英]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.

相关问题 Angular2中的协议方案问题仅支持跨源请求 - Cross origin requests are only supported for protocol schemes issue in Angular2 跨源请求仅支持协议方案:http - Cross origin requests are only supported for protocol schemes: http 交叉原始请求仅支持协议方案中的错误响应 - Cross origin requests are only supported for protocol schemes error in react 本地主机-仅协议方案支持跨源请求? - localhost - Cross origin requests are only supported for protocol schemes? 为什么我的catch块无法捕获“协议方案仅支持跨源请求:http…” - Why Is My catch Block Not Catching “Cross origin requests are only supported for protocol schemes: http…” AngularJS错误:仅支持协议方案的跨源请求:http,数据,chrome扩展,https - AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https 交叉源请求仅支持协议方案:http,数据,chrome,chrome-extension,https - Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https 仅协议方案支持React Native WebView Cross起源请求:http,data,chrome,https - React Native WebView Cross origin requests are only supported for protocol schemes: http, data, chrome, https 使用角度路由时出现错误仅协议方案仅支持跨源请求:http - Getting Error while using angular routing Cross origin requests are only supported for protocol schemes: http XMLHttpRequest:仅支持跨源请求 - XMLHttpRequest: Cross origin requests are only supported
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM