用于Java的STUN,TURN,ICE库 [英] STUN, TURN, ICE library for Java

查看:314
本文介绍了用于Java的STUN,TURN,ICE库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在两个用户之间建立P2P UDP和TCP连接。他们俩都在NAT背后。

I need to establish a P2P UDP and TCP Connection between two Users. Both of them are behind a NAT.

一点点研究引导我 STUN TURN ICE

A little research leads me to STUN, TURN and ICE.

是否有任何Java解决方案(库),除了 jSTUN 似乎仅适用于UDP。
和TURN,ICE对于对称NAT问题要好得多。

Is there any Java solution (library) except jSTUN which seems to work only on UDP. And TURN, ICE is much better for the symmetric NAT Problem.

推荐答案

不要过多地吹我自己的号角,但我可以建议您尝试 IcedJava 。 (它是SipTools项目的一部分)它正在积极开发,具有稳定版本0.9版本,并支持开箱即用的RTP流等用例。

Not to toot my own horn too much, but might I recommend trying IcedJava. (It's a part of the SipTools project) It's actively being developed, has a stable release 0.9 version, and supports use cases like RTP streaming out of the box.

目前为止作为TCP支持,这是为了以后的版本,但是由于三次握手被阻止,你将很难支持TCP超过对称nat。即使是ICE规范的TCP扩展也注意到TCP连接比成对同伴之间的UDP连接成功的可能性要小得多。

As far as TCP support, that's slated for a later release, but you're going to have a hard time supporting TCP over symmetric nat due to the three way handshake being blocked. Even the TCP extensions to the ICE specification note that TCP connections are much less likely to succeed than UDP connections between natted peers.

也就是说,你可以通过路由TCP解决这个问题UDP网桥上的数据包,包括所有纠错和流量控制功能。 (我忘了这个RFC,但它是最终的规范)但是,所有这些都是相对较新的规范,而ICE-TCP规范还不是最终的。即使在积极开发中,这些也需要时间来实现。

That said, you can workaround this by routing TCP packets over a UDP bridge, including all of the error correction and flow control features. (I forget the RFC for this, but it is a final specification) Still, all of these are relatively new specifications, and the ICE-TCP spec is not yet final. Even in active development, these will take time to implement.

这篇关于用于Java的STUN,TURN,ICE库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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