Search squid archive

Re: How to diagnose redirector?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Ursprungligt meddelande -----
> Från: "Tobias Reckhard" <tobias.reckhard@xxxxxxxxxxx>
> Till: squid-users@xxxxxxxxxxxxxxx
> Skickat: torsdag, 10 nov 2011 14:25:35
> Ämne: Re:  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



[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux