View Full Version : Block surfers using proxies

11-10-2004, 03:58 PM
I wish to put a javascript on my site that will redirect users if they are using a proxy.

Information, transmitted by a client to a server is available (accessible) for a server as environment variables. How do I get hold of these environmental variables in javascript??

I want to redirect surfers for when their environmental variable

HTTP_VIA = not empty

What is the above line in javascript?

I think this strategy will be good for redirecting users using a proxy as HTTP_VIA not being empty indicates the surfer using a proxy. Although of course it will not work for elite proxies - proxues that can hide that a proxy is even being used - where HTTP_VIA IS empty. Below, I have put a bit of info about the different proxy types for your interest.

P.S does anyone know what percentage of web surfers use a proxy? What percentage of these use a transparent proxy and what percentage an anonymous proxy?

1) Transparent Proxies They do not hide information about your IP address:
HTTP_VIA = proxy IP

2) Anonymous Proxies

a) simple anonymous proxies - these do not hide that a proxy is being used. They replace your IP with their own
HTTP_VIA = proxy IP

b) distorting proxies - these do not hide that a proxy is being used. They replace your IP with another (arbitary, random) IP
HTTP_VIA = proxy IP
HTTP_X_FORWARDED_FOR = random IP address

c) High Anonymity Proxies (Elite proxies)
HTTP_VIA = not determined
HTTP_X_FORWARDED_FOR = not determined

11-10-2004, 04:05 PM
this isn't a JS question. it's a serverside one. re-post or move to the appropriate forum. :D

Willy Duitt
11-10-2004, 08:53 PM
As Jbot pointed out... This is strictly serverside...
Guardian has a freely distributed script called AZenv: AZ Environment variables
which can be found here (http://clan.cyaccess.com/index.php?menusoft&az_env) and should be easily adaptable for your needs.....

There are actually 20 or more enviormental variables which can be checked for proxies.... But be advised, most (nearly all) surfers knowledgable enough to use a proxy will be surfing high anonymity so you will be most likely chasing ghosts...

I do not know the percentage of users that use proxies to protect their privacy but my network will only connect thru a proxy and/or SOCKS and nearly everyone I know does the same....


11-11-2004, 01:08 PM
My Q did have some relevance to javascript - I was asking whether you can get these environmental variables into variables into a javascript? So, I can play with them in javascript. I know that PHP and other server side is prob better - but for stubborness I want to use javascript if i can.

Willy Duitt
11-11-2004, 05:27 PM
simply assign the javascript variable value to that of the enviormental variable from the server....

12-02-2004, 04:33 PM
for stubborness I want to use javascript if i can.

and what if the user has JS turned off? 10-13% users have no JS support, that's a rather large chunk of your potential audience.

12-03-2004, 04:39 PM
so just get it to redirect in any case with javascript .. if they have no javascript it just doesnt move anywhere.. this page could display "please enable javascript" or something similar (i usually have insulting things behind frames and iframes anyway for if they are disabled:rolleyes: )

i dont really believe that statistic 10 - 13%.. i dont know anyone that uses this (i did a survey of 250 people and no1 had it disabled or a browser old enough to not have it.. however a college student showed me that his college would show up as using javscript if u just did it in a <script>...<script> on that page but if you tried to use <script src=".."></script> it didnt run it.. maby some automatic tests are fooled by this or something.. i just used <script>..</script> anyway