如何从远程主机确定哪个本地IP发送了请求
假设我有 1 个由许多计算机组成的网络,通过路由器 Wifi Dlink 或 NAT 设备连接到 Internet。另一端是直接连接到互联网的计算机,为连接的客户端提供一些服务。一旦本地网络的一台计算机通过互联网连接到另一端直接连接的计算机,我想通过套接字或其他方式确定直接连接的计算机上本地网络的哪台计算机发送了请求。这可能吗?
例如,我知道一些互联网服务提供商限制可能连接到互联网的计算机的数量,即使计算机位于路由器后面。这意味着互联网服务提供商可以通过这种方式确定路由器后面的哪台计算机执行了连接请求……并限制与所有其他计算机的连接。这怎么解释呢?
Suppose that I have 1 network of many computers connected to the Internet through a Router Wifi Dlink or a NAT device. On the other end a computer connected directly to the internet which provides some services to the connected clients. As soon one of the computer of the local network connects to the directly connected computer on the other end through the internet I want to determine on the directly connected computer through a Socket or in other ways which of the computer of the local network sent the request. Is this possible ?
I for example know that some Internet Service Providers limit the number of possible computers connected to the Internet even if the computer is located behind a router. It means that in such ways the Internet Service Providers could determine which computer behind the router has performed a connection request..and limits the connection to all the others. How to explain this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
直接从对象中找到这一点是不可能的。如果您需要知道发送系统的本地 IP 地址,我建议让客户端将信息发送到服务器,作为连接到服务器后的第一件事。因此,在接受连接后,服务器应该期望收到一组数据,其中包含刚刚连接的客户端发送的本地 IP 信息。
It is not possible to find this directly from the objects. What I would recommend if you need to know the local IP Address of the sending system, is have the client send the information in to the server as the first thing it does after it connects to the server. So, after accepting the connection the server should expect a set of data that will contain the local IP information send by the client that just connected.