Is it possible to retrieve IP behind NAT in PHP?
I am using $_SERVER["REMOTE_ADDR"]
for getting IP address of the client. It's not giving exact IP address of the client which is in behind NAT.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You cannot see the private address of client and usually you don't care to see it beacuse you can't access that. Even if it used a proxy, sometimes you may get address by:
Nope, not possible. NAT means Network Address Translation - the IP address of the packets is rewritten at the NAT device, so the public IP address is the only one, as far as your server knows.
However, you can employ some tricks - such as checking for the internal IP address using a Java Applet. See this: Get the correct local IP address from java applet
It is not possible to get the IP behind a NAT using HTTP and php.
if they are using proxy you can use
otherwise, it is not possible
No. PHP only sees the external IP.