通过 tcp 的 Webrtc 媒体? [英] Webrtc media over tcp?

查看:37
本文介绍了通过 tcp 的 Webrtc 媒体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 WebRTC 的新手.

I am new to WebRTC.

我了解了回合服务器.

下面的东西用于为 webrtc 应用程序配置在 TCP 上工作的轮流服务器.

The below thing is used to configure the turn server works on TCP for a webrtc application.

webrtc 应用程序中的轮流服务器配置示例:-

Example turn server configuration in webrtc application :-

{

       url: ‘turn:192.158.29.39:3478?transport=tcp’,  
       credential: ‘JZEOEt2V3Qb0y27GRntt2u2PAYA=’,
       username: ‘28224511:1379330808′

}

?transport=tcp 的意思是它像他们说的那样在 TCP 协议上工作.

The meaning for the ?transport=tcp is it works on TCP protocol like that they said.

我的问题是,

turn server 工作在 TCP 意味着,它仅用于在它工作在 TCP 上的 turn server 之间建立连接,或者通过它使用 TCP 协议的 turn server 传输 WebRTC 媒体.TCP数据包用于什么目的?

The turn server works on TCP means, it is only for establishing a connection between turn server it works on TCP or for transferring a WebRTC media via turn server it uses the TCP protocol. For which purpose the TCP packet is used ?

是否可以通过 TCP 数据包传输 WebRTC 媒体?

Is it possible to transfer the WebRTC media via the TCP packet ?

推荐答案

不推荐通过 TCP 强制 WebRTC 媒体,它只是严格防火墙的后备选项.

Forcing WebRTC media over TCP is not recommended, its just a fallback option for strict firewalls.

如果您在 TURN url 中指定 ?transport=tcp,那么 WebRTC 客户端将通过 TCP 连接到 TURN 服务器.
客户端将通过 TCP 发送 STUN 请求以分配中继候选(据我所知,目前 chrome/firefox 仅请求 UDP 中继候选).

If you specify ?transport=tcp in TURN urls, then WebRTC client will connect to TURN Server over TCP.
Clients will send STUN requests over TCP to allocate relay candidates (As far as i know, currently chrome/firefox only request UDP relay candidates).

通过 TURN 服务器强制严格 TCP:

  • 仅将 TURN url 与 ?transport=tcp 一起使用
  • 指定iceTransportPolicy:"relay",以便所有媒体都通过TURN流动
  • Use only TURN url with ?transport=tcp
  • Specify iceTransportPolicy:"relay", so that all media will flow via TURN

在peerConnections之间交换中继候选(udp)后,媒体路径如下

After exchanging the relay candidates(udp) between peerConnections, the media path will be as below

P1 <--TCP--> P1TURN <--UDP--> P2TURN <--TCP--> P2

P1 <--TCP--> P1TURN <--UDP--> P2TURN <--TCP--> P2

如果 P1TURN &P2TURN 总是相同的,那么您可以选择 TURN 中继路径作为 LAN/lo 接口,即您将获得具有 LAN/lo IP 的 UDP 中继候选.

If both P1TURN & P2TURN are always same, then you can choose TURN relay path as LAN/lo interface i.e. you will get UDP relay candidates with LAN/lo IP.

如果你想避免 UDP &在媒体路径中两次 TURN,您需要使用一些 SFU/SVC,例如 Jitsi(支持伪-SSL 候选)/Janus.
然后媒体路径将如下

If you want to avoid UDP & two times TURN in the media path, you need to use some SFU/SVC like Jitsi(supports pseudo-SSL candidates)/Janus.
Then media path will be as below

P1 <--TCP--> SFU/MCU <--TCP--> P2

P1 <--TCP--> SFU/MCU <--TCP--> P2

这篇关于通过 tcp 的 Webrtc 媒体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆