[squid-users] Perl Redirector Question

From: Bernard Barton <bfb21@dont-contact.us>
Date: Fri, 31 Mar 2006 07:15:46 -0500

I have a simple redirector which is run by squid. 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. Can someone
show me an example in perl of how to allow or deny a client in a
perl redirector?

FYI, I'm using the MaxMind GeoIP software which can determine what
country an IP address originates from. But just knowing how to allow
or deny an http request is what I'm after. Here's an example of what
I have so far:

#!/usr/bin/perl

$|=1;

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;
}
Received on Fri Mar 31 2006 - 05:15:54 MST

This archive was generated by hypermail pre-2.1.9 : Sat Apr 01 2006 - 12:00:05 MST