Tag: rfc5766turnserver

设置NodeJs WebRTCvideo通话,Turn / ICE失败,CORS被阻塞

我实际上已经遵循这个WebRTC codelab( https://codelabs.developers.google.com/codelabs/webrtc-web/#7 ),但是当需要连接到ICE服务器时卡住了。 基本代码在这里: main.js var pcConfig = { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' } […] if (location.hostname !== 'localhost') { requestTurn( 'https://computeengineondemand.appspot.com/turn?username=41784574&key=4080218913');} 通常,我得到以下错误:“ICE失败”或“跨源请求被阻止:同源策略不允许通过https://computeengineondemand.appspot.com/turn?username=41784574&key=4080218913阅读远程资源。 (原因:缺lessCORS头'Access-Control-Allow-Origin')。“ 根据后者,我已经启用了“A2enmod标题”,并将其设置为apache.conf“标题始终设置Access-Control-Allow-Origin”*“” 问题依然存在。 我的STUN服务器是“'url':'stun:stun.l.google.com:19302'”据我所知,STUN应该工作80%的时间。 但是这从来没有工作。 因此,即使TURN服务器不再工作,它应该有时与STUN连接?