| Apache2-FixRemote documentation | Contained in the Apache2-FixRemote distribution. |
Apache2::FixRemote - Reset remote IP with contents of X-Forwarded-For header
Version 0.01
# httpd.conf
PerlModule Apache2::FixRemote
PerlPostReadRequestHandler Apache2::FixRemote
# or alternatively use any handler stage after map-to-storage, such as:
<Location /foo>
PerlHeaderParserHandler Apache2::FixRemote
</Location>
Dorian Taylor, <dorian at cpan.org>
Please report any bugs or feature requests to
bug-apache2-fixremote at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Apache2-FixRemote.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Apache2::FixRemote
You can also look for information at:
Copyright 2006 Dorian Taylor, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Apache2-FixRemote documentation | Contained in the Apache2-FixRemote distribution. |
package Apache2::FixRemote; use warnings FATAL => 'all'; use strict; use Apache2::RequestRec (); use Apache2::Connection (); use Apache2::Log (); use Apache2::Const -compile => qw(OK); use APR::Table ();
our $VERSION = '0.01';
sub handler { my $r = shift; my $hdr = $r->headers_in->get('X-Forwarded-For'); if ($hdr and $hdr =~ /^\d+\.\d+\.\d+\.\d+$/) { my $old = $r->connection->remote_ip($hdr); $r->log->debug("Changed inbound IP from $old to $hdr"); } Apache2::Const::OK; }
1; # End of Apache2::FixRemote