Re: [squid-users] Partial working fine only

From: Colin Campbell <[email protected]>
Date: Tue, 31 Jul 2001 09:24:23 +1000 (EST)

Hi,

Isn't there a typo on the https line? I mean the "(". I also believe you
need to simplify your rewriting so that it's hostname based only. leave
out the protocol. What I think is happening is

a) under http, squid gets the following request

        GET http://www.dxnow.com HTTP/1.0
        <plus some other HTTP headers>

b) under https, what squid sees is

        CONNECT www.dxnow.com:443

Because of the rewrite rules, you are dropping into the "else" and so
squid is being asked to

        CONNECT http://10.10.10.23

which is being interpreted as connect to host "http" on port
"//10.10.10.23" which is probably being interpreted as "0" and defaulted
to 443.

So, what you really want, I think is the following:

#!/usr/bin/perl

$|=1;
while (<>) {
    if (/.*\.yahoo\..*/ ||
        /.*\.dynamex\..*/ ||
        /.*\.dxnow\..*/ ||
        /.*\.yellowpages\..*/ ||
        /.*\.mapquest\..*/ ||
        /.*\.theweathernetwork\..*/ ||
        /.*\.sun\..*/) {
        print;
    } else {
        print "http://10.10.10.23\n";
    }
}

You may also want to consider rewriting the ".*" as \w or \S.

On Mon, 30 Jul 2001, CGI wrote:

> My Squid server is working fine for http or https
> connection without redirector. In a configuration with
> a simple redirector, like this one, the https is not
> working, but looking in the cache.log I discovered
> that the connection is allowed:
>
> --------------------------------------------------
> #!/usr/bin/perl
>
> $|=1;
> while (<>) {
> if (/^http:\/\/.*\.yahoo\..*/ ||
> /^http:\/\/.*\.dynamex\..*/ ||
> /^(https:\/\/.*\.dxnow\..*/ ||
> /^http:\/\/.*\.yellowpages\..*/ ||
> /^http:\/\/.*\.mapquest\..*/ ||
> /^http:\/\/.*\.theweathernetwork\..*/ ||
> /^http:\/\/.*\.sun\..*/) {
> print;
> } else {
> print "http://10.10.10.23\n";
> }
> }

Colin
Received on Mon Jul 30 2001 - 17:24:38 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:01:20 MST