there is proxy headers implimenttation on Nette\Http\IRequest

Notice: This thread is very old.
alnux
Member | 139
+
0
-

Hi i want to implement a relative proxy detector transparent and some anonymous kind and i want to know if there is a function that catch al headers including proxy types or if i have to create a class calling $SERVER var. something like next

$proxy_headers = ARRAY(
     'HTTP_VIA',
     'HTTP_X_FORWARDED_FOR',
     'HTTP_FORWARDED_FOR',
     'HTTP_X_FORWARDED',
     'HTTP_FORWARDED',
     'HTTP_CLIENT_IP',
     'HTTP_FORWARDED_FOR_IP',
     'VIA',
     'X_FORWARDED_FOR',
     'FORWARDED_FOR',
     'X_FORWARDED',
     'FORWARDED',
     'CLIENT_IP',
     'FORWARDED_FOR_IP',
     'HTTP_PROXY_CONNECTION'
        );
FOREACH($proxy_headers AS $x){
     IF (ISSET($_SERVER[$x])) DIE("You are using a proxy.");
        EXIT;
}

thanks

Majkl578
Moderator | 1364
+
0
-

You should probably check it using Request#getHeader() somewhere in Application#onStartup[] event or Presenter#startup() method.