--- /dev/null
+#!/usr/bin/perl
+
+use constant UNLOCK_PROXY_URL => '/proxy/unlock';
+use constant UNLOCK_PROXY_HOST => qr/^yplom\.bicyclesonthemoon\.info(:[0-9]*)?$/;
+use constant UNLOCK_PROXY_PATH => qr/^\/proxy\/unlock\/?$/;
+
+if (($ENV{'HTTP_HOST'} =~ UNLOCK_PROXY_HOST) and ($ENV{'PATH_INFO'} =~ UNLOCK_PROXY_PATH)){
+# if (($ENV{'HTTP_HOST'} =~ /^yplom\.bicyclesonthemoon\.info(:(590)?80)?$/) and ($ENV{'PATH_INFO'} =~ /^\/proxy\/unlock\/?$/)){
+ unlockpage();
+}
+else {
+ debag();
+}
+
+sub unlockpage {
+ print "Content-type: text/html\n\n";
+ print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">';
+ print '<html lang="en"><head>';
+ print '<title>Unlock the proxy</title>';
+ print '<meta http-equiv="Content-type" content="text/html; charset=UTF-8">';
+ print '</head><body>';
+ print '<h1>Unlock the proxy</h1>';
+ print '<form method="get" action="'.UNLOCK_PROXY_URL.'">';
+ print '<b>Username: </b><input type="text" name="username"><br>';
+ print '<b>Password: </b><input type="password" name="password"><br>';
+ print '<input type="submit" value="unlock">';
+ print '</form></body></html>';
+ print "\n";
+}
+
+sub debag {
+ print "Content-type: text/plain\n\n";
+ print foreach $envk (keys %ENV) {
+ print "$envk = $ENV{$envk}\n";
+ }
+ print "\n";
+
+ foreach $line ( <STDIN> ) {
+ print $line;
+ }
+ print "\n\n";
+ if ($ENV{'REQUEST_URI'} =~ /^[a-z]*(:[0-9]*)?:\/\//){
+ #if
+ $URL=$ENV{'REQUEST_URI'}
+ }
+ else{
+ $URL='http://'.$ENV{'HTTP_HOST'}.$ENV{'REQUEST_URI'};
+ }
+ print 'URL: ',$URL,"\n";
+}
+
+
+
+
+