强制为WebRTC PeerConnections使用TCP [英] Force TCP for WebRTC PeerConnections

查看:641
本文介绍了强制为WebRTC PeerConnections使用TCP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过WebRTC强制进行TCP隧道(TLS)连接?

Is it possible to force a TCP tunneled (TLS) connection with WebRTC?

我们正在为我们的业务开发WebRTC应用程序,但由于内部网络而导致传入UDP流出现一些重大问题.我们已经在使用TURN服务器,并且正在获得一堆ICE候选对象(甚至是中继UDP候选对象).

We are developing a WebRTC application for our business, but we are experiencing some major issues with incoming UDP streams caused by our internal network. We are already using a TURN server and we are getting a bunch of ICE candidates (even relay UDP ones).

问题是,如上所述,我们的传入UDP流量在这里无法可靠运行(口吃,非常差的图像质量,非常低的fps).足以给浏览器以印象,WebRTC可以将其用于PeerConnection,但实际结果在UDP上是非常糟糕的.

The thing is, as I stated above, that our incoming UDP traffic does not work reliable here (stuttering, very bad image quality, very low fps). It's enough to give the Browser the impression, that WebRTC can use it for it's PeerConnection(s), but the actual result is very bad over UDP.

如果我阻止所有传出和传入的UDP流,则可以(在Wireshark中)看到WebRTC通过使用turn服务器回退到TCP流量.

If I block all outgoing and incoming UDP streams, I can see (in Wireshark) that WebRTC falls back to TCP traffic by using our turn server.

通过TCP连接,我们获得了很好的结果(高帧速率和非常好的图像质量).

With TCP connections, we are getting very good results (with high frame rates and a very good image quality).

我已经尝试了几种强制TCP的方法:

I've already tried several things to force TCP:

  1. 我删除了m = video行中的UDP部分

  1. I deleted the UDP part in the m=video line

m =视频TLS/RTP/SAVPF 10011611796

m=video TLS/RTP/SAVPF 100 116 117 96

我已经从候选列表中排除了每个UDP候选对象

I've excluded every single UDP candidate from my candidate list

在每种情况下,我什至都无法建立连接.

In each case I was not even able to establish a connection.

我可以采取什么措施在WebRTC中强制使用TCP,还是我们真的完全依赖这里的浏览器?

Is there anything I can do to force TCP in WebRTC or do we really depend completely on the browser here?

推荐答案

使用TURN/TCP服务器配置对等连接,并将iceTransports约束设置为中继.参见 http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ 请注意,质量通常比UDP差.

Configure the peerconnection with a TURN/TCP server and set the iceTransports constraint to relay. See http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ Note that quality is typically worse than over UDP.

浏览器到浏览器的连接不支持ICE-TCP.仅当您拥有SFU/MCU/网关产品时.

ICE-TCP is not supported for browser-to-browser connections. Only if you have a SFU/MCU/Gateway thing.

这篇关于强制为WebRTC PeerConnections使用TCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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