如果我有可以充当STUN的TURN服务器,客户端中的网址应该看起来像这样吗?
myPeerConnection = new RTCPeerConnection({
iceServers: [
{
urls: "turn:example.org"
}
]
});
还是这样?
myPeerConnection = new RTCPeerConnection({
iceServers: [
{
urls: "stun:example.org"
},
{
urls: "turn:example.org"
}
]
});
我只希望在必要时使用TURN功能,而不是每个连接都使用。
谢谢!
答案 0 :(得分:1)
您可以像第二个选项一样编写它。当stun方法不起作用时,它将尝试与stun服务器连接并回退到turn服务器。