The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Squid::Guard::Request - A request to Squid::Guard


    use Squid::Guard::Request;

    my $req = Squid::Guard->new($str);


Initializes a new Request object based on the string coming from Squid to the redirector.

Squid::Guard::Request->new( $str )

API call to create a new object. The $str parameter should be in the format used by Squid to pass a request to the redirection program: url addr/fqdn user method kvpairs.


Get request url


Get request address


Get request fqdn


Get request ident


Get request method


When called without arguments, returns a hash consisting of the extra key/value pairs found in the request. If an argument is supplied, it is taken as a key and the corresponding value (or undef) is returned. You can access the string of key/value pairs exactly as passed in the request by using _kvpairs instead

$req->_scheme() $req->scheme() $req->authority() $req->host() $req->_port() $req->port() $req->path() $req->query() $req->path_query() $req->authority_path_query() $req->fragment()

Get url components. These methods are inspired form the URI module.

If a port is not specified explicitly in the request, then $req->port returns the scheme's default port. If you don't want the default port substituted, then you can use the $uri->_port method instead. (behaviour consistent with URI module) Similarly, $req->_scheme reports the scheme explicitly specified in the requested url, or undef if not present (this is cthe case of CONNECT requests). When $req->_scheme is undef and $uri->_port is defined, $req->scheme is set to the port's default scheme.

$req->checksrcinnet($net, ...)

Checks if a request' source address is in one or more IP networks For the moment, only IPv4 addresses are supported, in the forms used in squid.conf acl of type src


Checks if a request is for an explicit IP address