I need to know if clients access my website directly or through a proxy. this is for security requirements.
I used a code like the following
if($_SERVER["HTTP_X_FORWARDED_FOR"]||$_SERVER["HTTP_VIA"]||
$_SERVER["HTTP_CLIENT_IP"])
echo "proxy connection";
else
echo "direct connection";
However this worked only when accessing the website through http:// but when accessing it through https:// all variables $SERVER["HTTP_X_FORWARDED_FOR"] and $SERVER["HTTP_VIA"] and $_SERVER["HTTP_CLIENT_IP"] are empty
I used a public proxy server for testing. Its IP is 200.65.127.163 port is 80
It supports both normal http and secured http connections.
N.b: I know there are the highly anonymous proxies that normally can't be detected but at least I need to detect the normal anonymous proxies when opening my website through ssl
Any help appreciated.
Thanks