Re: [squid-users] How to diagnose redirector?

From: Markus Nilsson <markus_at_markusoft.se>
Date: Thu, 10 Nov 2011 14:40:46 +0100 (CET)

----- Ursprungligt meddelande -----
> Från: "Tobias Reckhard" <tobias.reckhard_at_secunet.com>
> Till: squid-users_at_squid-cache.org
> Skickat: torsdag, 10 nov 2011 14:25:35
> Ämne: Re: [squid-users] How to diagnose redirector?
>
> Markus Nilsson wrote the following on 10.11.2011 13:56:
> > I might be wrong here, but I believe the URL is the first item,
> > i.e.
> >
> > $url = $X[0]
> >
> > The second part is the IP, and the third the username, e.g.
> >
> > http://www.siegel.de 1.2.3.4/- -
>
> OK, I changed the script to read $X[0] as $url and it's become
> slightly
> better:
>
> script Test:
> # echo http://www.siegel.de foobar | ./redirect.pl
> 302:http://www.spiegel.de
>
> squidclient test:
> # squidclient -r http://www.siegel.de
> HTTP/1.0 302 Moved Temporarily
> Server: squid/2.7.STABLE3
> Date: Thu, 10 Nov 2011 13:20:12 GMT
> Content-Length: 0
> Location: http://www.siegel.de/
> X-Cache: MISS from 254.5.28.10.in-addr.arpa
> X-Cache-Lookup: HIT from 254.5.28.10.in-addr.arpa:3128
> Via: 1.1 254.5.28.10.in-addr.arpa:3128 (squid/2.7.STABLE3)
> Connection: close
>
> The 302 code looks promising, but the location header is still wrong,
> isn't it?
>
> Puzzled...
> Tobias
>

You could just print the input string you get from Squid to a log file to see the syntax.

Maybe you don't get the "http://" part either? Update the perl replace to ignore the http on the input, and just adding it on the 302-redirect response. That's how I've written my redirector :)

/Markus
Received on Thu Nov 10 2011 - 13:40:54 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 11 2011 - 12:00:02 MST