使用服务器进行NAT遍历 [英] NAT Traversal With Server

查看:588
本文介绍了使用服务器进行NAT遍历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我在互联网上寻找有关该主题的信息,但有些东西丢失且不清楚。



我创建应用程序设置在我的客户PC上,问题开始时我的客户计算机设置在路由器后面,PC上的应用程序通过客户端的电话设备更新。 br />


我看到实现端口转发的文章[大多数在某些路由器上运行不正常]。

我还读到了STUN / STUNT / TURN / ICE解决方案。



我的问题是[TCP],



我有服务可以运行服务器与公共IP。

另外,我知道计算机公共IP [路由器IP]和私人IP [计算机IP,NAT]和端口号,我有这台计算机的唯一名称。



路由器后面的计算机将用他的详细信息[公共,私人IP和端口号]更新服务器。



当新客户想要与特定计算机建立连接时,他将从服务器收到所有计算机详细信息[根据计算机名称]。


我的问题是,如果我们知道上面的所有细节没有进行端口转发和其他魔术的话,是否可以向路由器后面的计算机发送消息。



谢谢。

MAK

Hello,

I looking for information in the internet about the topic, but something was missing and unclear .

I create application that set on my customers PC, the problem begin when my customer computer set behind router, the application on the PC update by his client's phone device.

I see articles that implement port forwarding [most of them not working well on some routers].
I also read about STUN/STUNT/TURN/ICE solutions .

My question is [TCP],

I have service that run on server with public i.p .
Also ,I know the computer public I.P [router I.P] and in addition the private I.P [computer I.P ,NAT] and the port number , I have unique name for this computer .

The computer behind the router will update the server with his details [public,private i.p and port number] .

When new client want to establish connection to specific computer he will receive from the server all the computer details [according to computer name].

My question if it's possible to send message to computer behind router if we know all the details above w/o making port forwarding and other magic.

Thanks.
M.A.K

推荐答案

简短的回答是:如果路由器正在执行NAT,那么不,你必须转发一个端口是为了做你正在尝试的事情。这说明它不一定是一个繁琐的手工事件,如果路由器支持upnp,你可以在PC上的app中使用upnp来让路由器自动转发端口。请注意,使用upnp可能会带来安全风险。



另一种方法是让PC连接到服务器并保持连接,然后您可以使用服务器通过该连接在客户端和PC之间传递信息。
Short answer is: if the router is performing NAT then no, you'll have to forward a port in order to do what you're attempting. That said it doesn't have to be a tedious manual affair, you could use upnp in your app on the PC to get the router to forward a port automatically if the router supports upnp. Just be aware that using upnp can pose a security risk.

The other way to do it would be to make the PC connect to the server and maintain the connection, then you can use the server to relay information between your client and the PC through that connection.


这篇关于使用服务器进行NAT遍历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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