![TURN TURN]()
本文介绍了是否可以在提供需要凭据的不同 TURN 服务器的对等方之间成功协商 WebRTC 连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我们使用全球 TURN 服务器 (Xirsys) 提供商.在对等点之间建立连接时,每个对等点首先标识离其位置最近的 TURN 服务器,然后获取该服务器的凭据.然后,对等方交换 ICE 候选项,包括各自的 TURN 服务器 URL.We use a provider of global TURN servers (Xirsys). When establishing a connection between peers, each peer first identifies the closest TURN server to their location, then fetches credentials for that server. The peers then exchange ICE candidates, including their respective TURN server URLs.如果这些peer在不同的区域,他们会提议不同的TURN服务器.根据对这个问题的公认答案:TURN-Server for RTCConfiguration 各自的 TURN 服务器将 相互连接以中继来自 Peer1 的流TURN1 <>TURN2 <>同行2.但是,我一直无法让它发挥作用.在客户端中强制 TURN(即没有直接的 p2p 连接),并尝试使用 TURN 服务器建立 peerConnection,例如美国到巴西,谈判总是失败.If those peers are in different regions, they will propose different TURN servers. According to the accepted answer to this question: TURN-Server for RTCConfiguration the respective TURN servers will connect to each other to relay streams from Peer1 <> TURN1 <> TURN2 <> Peer2. However, I have been unable to get this to work. Forcing TURN in the clients (i.e. no direct p2p connections), and attempting to establish a peerConnection using a TURN server in e.g. the United States to one in Brazil, negotiation always fails.这是因为服务器需要的凭据未在 ICE 候选中传递吗?或者它可能是特定于 Xirsys 的问题?或者它真的应该工作正常而我们做错了什么?Is this because the servers require credentials that are not passed in the ICE candidates? Or perhaps it's a Xirsys-specific problem? Or should it actually work fine and we're doing something else wrong?推荐答案不,不是因为凭据.它们用于客户端和它的 TURN 服务器之间.TURN 服务器和远程端点之间的连接不使用任何身份验证.No it's not going to be because of the credentials. They are used between the client and its TURN server. The connection between the TURN server and remote end point doesn't use any authentication.事实上,每个 TURN 服务器都应该幸福地不知道远程方甚至是另一个 TURN 服务器.就他们而言,无论是浏览器、另一个 TURN 服务器还是其他一些应用程序,他们都将数据包转发到远程端点.In fact each TURN server should be blissfully unaware that the remote party is even another TURN server. As far as they are concerned they forward packets to the remote end point just the same no matter whether it's a browser, another TURN server or some other application. 这篇关于是否可以在提供需要凭据的不同 TURN 服务器的对等方之间成功协商 WebRTC 连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-12 20:35