25 Apr 2021 17:54:18 UTC
- Distribution: Plack-Middleware-RealIP
- Module version: 0.04
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Testers (128 / 0 / 0)
- KwaliteeBus factor: 1
- 93.59% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (3.88KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionSHERWIN Sherwin Daganato
Plack::Middleware::RealIP - Override client IP with header value provided by proxy/load balancer
enable 'Plack::Middleware::RealIP', header => 'X-Forwarded-For', trusted_proxy => [qw(192.168.1.0/24 192.168.2.1)];
Plack::Middleware::RealIP is loose port of the Apache module mod_remoteip. It overrides
REMOTE_ADDRwith the IP address advertised in the request header configured with
When multiple, comma delimited IP addresses are listed in the header value, they are processed from right to left. The first untrusted IP address found, based on
trusted_proxy, stops the processing and is set to be
REMOTE_ADDR. The header field is updated to this remaining list of unconfirmed IP addresses, or if all IP addresses were trusted, this header is removed from the request altogether.
Sets a request header to trust as the client IP, e.g. X-Client-IP
A list of IP addresses or subnet blocks which are trusted to provide IP header.
Sherwin Daganato <firstname.lastname@example.org>
Most of the logic is based on Plack::Middleware::XForwardedFor by Graham Barr
jmaslak: Joelle Maslak <email@example.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Plack::Middleware::RealIP, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Plack::Middleware::RealIP
For more information on module installation, please visit the detailed CPAN module installation guide.