【问题标题】:Relay candidates are not generated in Google ChromeGoogle Chrome 中未生成接力候选人
【发布时间】:2015-03-27 01:50:15
【问题描述】:

为了测试我是否获得了接力候选人,我正在使用这个页面:http://googlechrome.github.io/webrtc/samples/web/content/peerconnection/trickle-ice/。为了从 chrome 40 进行测试,我在那里提供了我的轮到 url 和凭据。单击收集候选人后,我看不到接力候选人。在 firefox 36 上做同样的测试,我找到了接力候选人。可能是什么问题?为了进一步调查这个问题,我查看了 wireshark 日志。我发现,来自 firefox 的 stun 请求格式包括 -

STUN 146 Allocate Request UDP lifetime: 3600 user: lazy realm:  with nonce

但是从 chrome 来看,这略有不同-

STUN 70 Allocate Request UDP

请求代码似乎不一样。此外,来自 chrome 的请求不包括生命周期、用户和领域属性。

【问题讨论】:

    标签: webrtc stun turn rfc5766turnserver


    【解决方案1】:

    我知道这个问题已经有点老了,但是根据我的经验,TURN 服务器描述格式(关于身份验证)在 Chrome 和 Firefox 中必须采用不同的格式。

    对于 chrome,您可以使用:{"url":"turn:user@turn.example.com", credential:"password"},

    对于 Firefox,格式为: {"url": "turn:turn.example.com", 'hasCredentials': true, username:"user", credential:"password"},

    也许您可以查看源代码以查看示例中如何设置回合服务器。

    编辑: 同时,规范中的服务器列表格式已更改 (https://www.w3.org/TR/webrtc/#rtciceserver-dictionary)。目前我知道的所有实现都支持这种格式:

    { "urls": ["turns:turn.example.org", "turn:turn.example.net"],
       "username": "user",
       "credential": "myPassword",
       "credentialType": "password"
    }
    

    但在 Edge 上,您似乎需要在 url 中包含查询字符串 ?transport=udp。

    【讨论】:

    • 我在原生 ios 中遇到问题,您能帮忙格式化一下吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-09
    • 2018-11-23
    • 1970-01-01
    • 2019-08-29
    • 1970-01-01
    • 1970-01-01
    • 2016-08-10
    相关资源
    最近更新 更多