安卓:NAT穿越? [英] Android: NAT Traversal?

查看:225
本文介绍了安卓:NAT穿越?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来较新的Andr​​oid设备在NAT之后,本地地址是内部的载体或LAN地址与​​公网地址是分配外部地址的路由器或承运人运行。

It appears to me that newer Android devices run behind a NAT, where the local address is an internal carrier or LAN address and the public address is the router or carrier assigned external address.

然而,较新的手机不返回使用的NetworkInterface相同的地址访问的IP检测服务时

Nevertheless, newer phones don't return the same address using the NetworkInterface as when accessing an IP detection service.

因此​​,通过直接的P2P SocketChannels连接本身出现故障。

Therefore, connecting via direct P2P SocketChannels inherently fails.

有没有共同的解决方法,此问题专为Android平台?任何人都可以澄清是什么原因造成这种NAT样的安全问题?

Are there any common workarounds to this problem designed for the Android platform? Can anyone clarify what is causing this NAT-like security issue?

到Java NAT穿越的任何链接的教程示例不会文章或论文)也将是AP preciated作为是有帮助(因为我不是很清楚如何在Java中实现它)。

Any links to Java NAT traversal tutorials or examples (NOT essays or theses) would also be appreciated as being helpful (as I'm not quite sure how to implement it in Java).

我也会接受任何其他的解决方案,任何人来!

I will of course also accept any other solutions anyone has to offer!

推荐答案

几乎每个手机或电脑,你将永远碰不具有静态公网IP地址,因此需要NAT穿越。这是该设备不是因为;运营商或ISP把路由器设备与公共互联网之间。根据您的应用程序,通常有NAT穿越库,就可以使用,如 ice4j 或<一HREF =htt​​p://nutss.gforge.cis.cornell.edu/stunt.php>特技。

Almost every phone or PC you will ever touch won't have a static public IP address, and therefore will require NAT traversal. It's not because of the device; the carrier or ISP put routers between your device and the public internet. Depending on your application, usually there are NAT-traversal libraries you can use, such as ice4j or STUNT.

这篇关于安卓:NAT穿越?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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