Re: [squid-users] Perl Redirector Question

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Sat, 01 Apr 2006 23:54:28 +0200

fre 2006-03-31 klockan 07:15 -0500 skrev Bernard Barton:
> I have a simple redirector which is run by squid.

Ok.

> What I want to do in the
> redirector is check the IP address of the client, and if it's a valid
> IP, allow
> it to pass through to the web server. If not, then block it.

Why do you want to use a redirector for this? Isn't an ACL more
suitable? See external_acl_type if you need to plug in an external
program in the acl processing.

> while (<>) {
> open LOG, ">>/tmp/redir.log";
> printf LOG "Got input: $_\n";
> ##s@http://131\.215\.66\.103@http://www.xyz.com@;
> printf LOG "Output is: $_\n";
> close LOG;
> }

You also need to print out some result... just add a print statement
inside that loop and you should be fine..

Regards
Henrik

Received on Sat Apr 01 2006 - 14:54:35 MST

This archive was generated by hypermail pre-2.1.9 : Mon May 01 2006 - 12:00:01 MDT