proxy detection and cgi variables
Just want to ask you about something that is bothers me, For few weeks i have a strange situation for one of my projects for which my client insists that project should have a proxy detection mechanism in order to deny access to those visitors who's landing into website from behind a proxy server.
Theoretically i know how to handle this; parsing browser request headers values in searching for specific proxy headers like:
1. for normal transparent proxy it is enought that
HTTP_X_FORWARDED_FOR exists.
2. for anonymous and high-anonymous would be:
HTTP_X_FORWARDED_FOR, HTTP_VIA, HTTP_X_PROXY_ID
So, i put a proxy address in my browser and access a simple page that
only dumps cgi scope variables.
(<cfdump var="#cgi#" label="cgi variables" />
But, no luck. None of those values from above seems to show up althought i see that remote_addr shows me the ip of proxy server confirming me that i use a proxy.
So code like:
<cfif IsDefined("CGI.HTTP_X_FORWARDED_FOR") AND CGI.HTTP_X_FORWARDED_FOR NEQ ''>
proxy detected
<cfelseif IsDefined("CGI.HTTP_VIA") AND CGI.HTTP_VIA NEQ ''>
high-anon proxy detected
<cfelse>
you are clean ![]()
</cfif>
would not have any chance. I have used this simple line of code into ACF 7 MX (with apache 2.0.53 - mod_jrun20.so) or into my laptop to ACF 9 developer edition ( with apache 1.3.41 mod-ssl / mod_jrun.so - calling page from another pc in the same network).
Funny thing is that a php page via normal apache vhost gives me those variables leading me to think that it might not be an apache problem or at least i can not see it.
srv#cat testp.php
<?php
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ||
($_SERVER['HTTP_USER_AGENT']=='') || ($_SERVER['HTTP_VIA']!='')){
die("Don't use proxies, please.");
?>
am i missing something? those $_SERVER variables from php does have other corespondent into ACF ?
thanks very much for anybody time.