On Thu, Nov 15, 2007, Adrian Chadd wrote:
> I've started work on the store url rewriter stuff in Squid-HEAD.

Its now spitting URLs to the redirector and reading them back. Its not yet
using this in the request_t.

The redirector I'm currently using:

#!/usr/bin/perl -w

$| = 1;

while (<>) {
        chomp;
        # print STDERR $_ . "\n";
        if (m/kh(.*?)\.google\.com(.*?)\/(.*?) /) {
                print "http://keyhole-srv.google.com"; . $2 . ".SQUIDINTERNAL/" 
. $3 . "\n";
                # print STDERR "KEYHOLE\n";
        } elsif (m/mt(.*?)\.google\.com(.*?)\/(.*?) /) {
                print "http://map-srv.google.com"; . $2 . ".SQUIDINTERNAL/" . $3 
. "\n";
                # print STDERR "MAPSRV\n";
        } else {
                print $_ . "\n";
        }
}

Example rewritten URL:

2007/11/15 14:46:27| clientStoreURLRewriteDone: 
'http://kh2.google.com.au/kh?n=404&v=22&t=tqtss' 
result=http://keyhole-srv.google.com.au.SQUIDINTERNAL/kh?n=404&v=22&t=tqtss
2007/11/15 14:46:27| clientStoreURLRewriteDone: 
'http://kh3.google.com.au/kh?n=404&v=22&t=ttqrr' 
result=http://keyhole-srv.google.com.au.SQUIDINTERNAL/kh?n=404&v=22&t=ttqrr
2007/11/15 14:46:27| clientStoreURLRewriteDone: 
'http://mt2.google.com/mt?n=404&v=w2t.61&x=3&y=7&zoom=13' 
result=http://map-srv.google.com.SQUIDINTERNAL/mt?n=404&v=w2t.61&x=3&y=7&zoom=13
2007/11/15 14:46:27| clientStoreURLRewriteDone: 
'http://mt3.google.com/mt?n=404&v=w2t.61&x=3&y=8&zoom=13' 
result=http://map-srv.google.com.SQUIDINTERNAL/mt?n=404&v=w2t.61&x=3&y=8&zoom=13

Comments are welcome.




Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -

Reply via email to