A
A
andrewnsk2017-01-09 12:17:35
PHP
andrewnsk, 2017-01-09 12:17:35

How to determine the ip address behind the mobile browser proxy (Liveinternet detects it, but I can't)?

Hello!
Mobile chrome uses the traffic saving feature and uses a proxy server. I'm trying to determine the ip address of the client using a script, but I get an ip proxy. Liveinternet determines the ip of the client. How is it possible to determine the ip of the client?
I am using the following script

function getRealIpAddr() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) // Определяем IP
{ $ip=$_SERVER['HTTP_CLIENT_IP']; }
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) // Если IP идёт через прокси
{ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }
else { $ip=$_SERVER['REMOTE_ADDR']; }
return $ip;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Dubrovin, 2017-01-09
@andrewnsk

X-Forwarded-For - non-standard header. Currently the default header is Forwarded, add parsing this header in addition to X-Forwarded-For. Note that it has a slightly different format.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question