简体   繁体   English

假设用户将他的 IP 和端口发送给另一个用户,为什么 WebRTC 需要一个信令服务器来进行数据连接?

[英]Assuming a user sends his IP and port to another, why does WebRTC need a signaling server for a data connection?

In all serverless (not including ICE/STUN) implementations of WebRTC, that create a data connection, I've always noticed that the flow is:在创建数据连接的 WebRTC 的所有无服务器(不包括 ICE/STUN)实现中,我一直注意到流程是:

  • User 1 sends contact info to user 2.用户 1 将联系信息发送给用户 2。
  • User 2 processes contact info and sends reponse to user 1.用户 2 处理联系信息并向用户 1 发送响应。
  • Users can now communicate.用户现在可以交流了。

What I don't understand is why do we need the second step?我不明白的是为什么我们需要第二步? In desktop apps, the first step is enough, even if there's a NAT (due to STUN servers).在桌面应用程序中,第一步就足够了,即使有 NAT(由于 STUN 服务器)。 Is this some WebRTC limitation?这是一些 WebRTC 限制吗? If so, why?如果是这样,为什么?

Besides ICE candidates, SDP contains information about codecs, tracks etc. Signaling server is needed as a channel to establish a connection between peers by exchanging such information.除了 ICE 候选者,SDP 还包含有关编解码器、轨道等的信息。需要信令服务器作为通过交换此类信息在对等方之间建立连接的通道。

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

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