服务器如何找到真实的客户端IP地址? [英] How can a server find real client IP address?

查看:961
本文介绍了服务器如何找到真实的客户端IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只能从NAT和代理后面的地方访问互联网。 此网站也会显示我的机器的专用LAN地址,以及我的NAT的公共地址。他们显然在这个过程中使用了javascript,但我只能找到他们设置值的代码,而不是他们如何找到它。那么,我们如何使用javascript找出客户端机器的私有IP地址?

I can only access the internet from my place from behind a NAT and a proxy. This site however also shows my machine's private LAN address, as well as my NAT's public address. They are apparently using javascript in the process, but I can only find code where they set the value, but not how they find it. So, how can we find out the private IP address of a client machine using javascript?

推荐答案

你确定你落后了吗? 只是 NAT路由器?如果您在代理服务器后面,代理服务器可能会添加 X-Forwarded-For 标头。

Are you sure you're behind just a NAT router? If you're behind a proxy, the proxy might well be adding an X-Forwarded-For header.

这篇关于服务器如何找到真实的客户端IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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