Re: Using Perl to find what address bar says

On Nov 8, 1:53 am, jwcarlton <jwcarl...@xxxxxxxxx> wrote:
Can you guys think of a way, in Perl, to find what the address bar
actually says? I don't think that $ENV{'SCRIPT_NAME'} is quite the
same, because it's only going to show me what it's SUPPOSED to be.

I'm trying to find if a user is using something like or, and it seems like the easiest method is to compare
$ENV{'SCRIPT_NAME'} to the address bar. I can do it in Javascript, but
I'm hoping there's a way to do it in Perl.

In spite of the "genius" replies saying that this is impossible and
that I'm an idiot for asking, for future readers, there IS a way to
find if a user is using something like or
using Perl.

First, upload phpinfo.php (I know, that's PHP. Whatever. You can do it
in Perl if it suits your fancy):


Now, load this normally in your browser, then load it again using, or whatever other proxy you want.

Doing a side-by-side comparison, you'll see several discrepancies. The
most notable on my end is that didn't recognize Session
Handling; so, I can simply load a session variable on one page, then
test for that variable on the next page. If it doesn't exist, then
they're probably using a proxy.

It's not perfect, since browsers with cookies disabled probably
wouldn't recognize sessions, either. But since my site would be
virtually unusable without cookies, I'm not so concerned about that.

If that won't work for you, another discrepancy found was that on a
normal load, HTTP_CONNECTION is set to "Keep-Alive"; but, using
proxies, it's not set. So, a simple check for $ENV{HTTP_CONNECTION}
might be all that's needed.

There were several discrepancies, though, so using this method you can
pick and choose what's different on your server.

Please don't bother replying to this thread, as I don't intend to
return. My email address is here, though, so feel free to email