28 Januari 2009

 

Simple Redirection script for squid

#!/usr/bin/perl
$|=1;

while (<>) {

    @X = split; $url = $X[0]; $url =~s/[\n|\r]//gi; $gurl = $url;

    # kecuali address mu
 
    if (
        ($gurl =~ /^http\:\/\/what\.youraddress\.net/) ||
        ($gurl =~ /^http\:\/\/192\.168\.192\.254/) ||
        ($gurl =~ /^http\:\/\/other\.youraddress\.net/)
    ){
        print "$gurl\n";
    } else {
        print "http://youraddress.net/togo\n";
    }

}

exit;

In squid.conf put/add
url_rewrite_program /yourpath/this-redirect-script
url_rewrite_children 12

Label: ,


Komentar:

Posting Komentar

Berlangganan Posting Komentar [Atom]





<< Beranda

Arsip

Januari 2009   Oktober 2009   November 2009   Maret 2010   Januari 2011   Februari 2011   Juli 2011   Juni 2012