网络应用问题 [英] Network application issue

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

问题描述

我编写了一个应用程序,该应用程序坐在计算机上侦听某个网络端口.问题在于PC在具有NAT的路由器后面,该NAT将阻止将要到达的所有未映射的数据包.

我的应用程序已经在向我的网站发送我需要的所有数据,例如路由器的外部地址...(这是通过ASP.NET请求变量完成的)
例如:HTTP_X_FORWARDED_FOR 162.17.150.151、10.0.2.42和REMOTE_HOST 119.101.93.8(当然我更改了这些).
所以我想做的就是将数据发送到路由器,并告诉它要像Web服务器一样将数据转发到哪个主机,并且由于路由器不是我的路由器,我绝对不希望对路由器进行任何手动配置.
基本上,我试图在不需要第三方的情况下建立对等通信,而且我不认为这是不可能实现的.

请帮助我,请记住,我不想为路由器进行任何配置.

I have written an application that is sitting on a computer listening on a certain network port. The problem is that the PC is behind a router that has a NAT that will block any unmapped packets that will arrive.

My application is already sending to a website all the data I need like router external address...(this is done through ASP.NET request variables)
Example: HTTP_X_FORWARDED_FOR 162.17.150.151, 10.0.2.42 and REMOTE_HOST 119.101.93.8 (of course I changed those).
So what I''m trying to do is send data to the router and telling it to which host to forward it exactly like a web server does and I want absolutely no manual configuration for the router because the router is not mine.
Basically I''m trying to establish a peer to peer communication without the need of a third party and I don''t see how this is impossible to make.

Please help me and remember that I don''t want to make any configuration for the router.

推荐答案

您在NAT路由器后面的应用程序必须启动连接,并且保持打开状态.然后,外部系统必须使用该连接来与原始系统进行通信,如果不更改路由器配置,外部系统将无法以其他方式工作.

远程系统是否具有来自先前连接的信息都没有关系.它无法在以后启动连接.

甚至在其配置中的P2P系统中,您都需要将端口转发放入NAT路由器中,以使系统正常运行.
Your application behind the NAT router has to initiate the connection, and keep it open. The external system then has to use that connection to communicate back to the originating system, it can NOT work the other way around without changing the router configuration.

It doesn''t matter if a remote system has the information from a previous connection. It cannot initiate a connection at a later time.

Even P2P systems in their configuration say that you need to put port forwarding into NAT routers for the system to work properly.


先生.罗德·肯普

你说:
NAT路由器后面的应用程序必须启动连接并保持打开状态.然后,外部系统必须使用该连接来与原始系统进行通信...

我理解这个概念,但是我必须以编程方式做什么?
启动连接并保持打开状态意味着什么?
如果您以前没有做过,那么您至少可以指导我阅读文章或开放源代码项目吗?

顺便说一句,我不知道路由器是否保存了来自网络内部的请求记录.
非常感谢您的帮助...
Mr. Rod kemp

You said:
Your application behind the NAT router has to initiate the connection, and keep it open. The external system then has to use that connection to communicate back to the originating system...

I understand the concept but what do I have to do programmatically?
What does it mean to initiate the connection and keep it open?
If you have not done that before, can you at least guide me to an article or an open source project?

BTW, I did not know that the router keeps a record of requests from inside the network.
I appreciate your help very much...


这意味着它的意思:打开与远程系统的TCP连接,然后保持打开状态.远程系统现在可以通过开放渠道与您的系统通信.

您也可以通过UDP会话来完成此操作,但这更加复杂.您将必须定期刷新会话,因为路由器在(可配置的)不活动时间段后会忘记" UDP会话(并且管理路由器的人员可能已完全阻止了此功能).

我必须警告您,您尝试做的事情对我来说似乎非常可疑,在大多数公司中都将其视为解雇的原因.在防火墙中制造漏洞严重违反了安全性.
It means just what it means: Open a TCP connection to the remote system, and just leave it open. The remote system can now communicate back to your system through the open channel.

You could also do it through a UDP session, but this is more complicated. You would have to refresh the session periodically, because the router ''forgets'' UDP sessions after a (configurable) period of inactivity (and the person who administers the router may have blocked this functionality altogether).

I must warn you that the things you are trying to do look highly suspicious to me, and would be considered a cause for dismissal in most companies. Creating holes in firewalls is a serious breach of security.


这篇关于网络应用问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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