package Apache::ProxyAddr; use Apache::Constants qw(:common); sub handler { my $r = shift; if ($r -> header_in('X-Forwarded-For') =~ /([^,\s]+)$/) { $r -> connection -> remote_ip($1); } return OK; } 1;