英文:
Can both ends of WebRTC specify iceTransportPolicy as "relay" for same one turn server?
问题
Alice
和 Bob
使用 WebRTC 建立连接,有一个 TURN 服务器可用。
Alice
和 Bob
都将他们的 iceServers
设置为这个服务器,并将 iceTransportPolicy
设置为 "relay"。
奇怪的是,我无法在两者之间建立连接。我的 TURN 服务器是 Coturn。为什么?
英文:
Assuming Alice
and Bob
are using WebRTC to establish a connection, and there is a TURN server available.
Both Alice
and Bob
set their iceServers
to this server and also set the iceTransportPolicy
as "relay".
Strangely, I am unable to establish a connection between the two. My turn server is Coturn. Why?
答案1
得分: 0
Your first question is easy: yes, both (and should) set the policy to relay
if that's what you want to enforce.
The second question, why does it not work, is difficult to answer without more detail. Perhaps the better question is how to debug this, so that's how I'll try to help. I usually do this by printing all returned candidates to the console of type relay
. If either side does not receive any such candidates, then you have a smoking gun (often an authentication issue with coturn).
The other helpful tool is the telnet CLI coturn has (see the /etc/turnserver.conf
file for details). Activate that, log in, and use ps
to show all current sessions. You should find two active sessions, one for each side.
英文:
Your first question is easy: yes, both (and should) set the policy to relay
if that's what you want to enforce.
The second question, why does it not work, is difficult to answer without more detail. Perhaps the better question is how to debug this, so that's how I'll try to help. I usually do this by printing all returned candidates to the console of type relay
. If either side does not receive any such candidates, then you have a smoking gun (often an authentication issue with coturn).
The other helpful tool is the telnet CLI coturn has (see the /etc/turnserver.conf
file for details). Activate that, log in, and use ps
to show all current sessions. You should find two active sessions, one for each side.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论