简体   繁体   English

webrtc ice_server从未注册为候选冰

[英]webrtc ice_server never registeres as ice candidate

I am building a webrtc client where i am using a turn and stun server. 我正在使用转弯和眩晕服务器构建一个webrtc客户端。 This is working if i am turning of the firewall. 如果我要打开防火墙,则此方法有效。 When i breakpoint the on ice candidate function i see that my ice servers are not added as ICE candidate. 当我断点on ice候选函数时,我发现我的ice服务器没有作为ICE候选添加。

This is the code: 这是代码:

var rtc_configuration =
    {
        iceServers: [
            {urls: "stun:numb.viagenie.ca"},
            {urls: "turn:numb.viagenie.ca", username: "username", credential: "credential", credentialType: "password"}
        ],
        bundlePolicy: "balanced",
        iceTransportPolicy: "all",
        rtcpMuxPolicy: "negotiate",
        iceCandidatePoolSize: 20,
        certificates: []
    };
    var peer_connection = new rtc_peer_connection(rtc_configuration);
    peer_connection.onicecandidate = pc_on_ice_candidate;

but when i breakpoint on the onicecandidate funtion, only the default candidates are added, and not the ice servers that are in the configuration. 但是当我在onicecandidate函数上断点时,仅添加默认的候选对象,而不添加配置中的ice服务器。 I am using the last version of firefox. 我正在使用最新版本的Firefox。

Does anybody have a suggestion? 有人有建议吗?

我认为问题是因为TURN服务器传输类型是UDP,并且由于防火墙的原因,UDP端口将被阻止,因此没有ICE候选者,请尝试使用TCP传输模式添加TURN凭据...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM