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

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

问题描述

我是WebRTC的新手.

I am new to WebRTC.

我了解到转弯服务器.

I was learned about the turn server.

下面的内容用于配置转交服务器在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服务器在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网址中指定?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网址与?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&在媒体路径中转动两次,您需要使用一些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天全站免登陆