Mojolicious-Plugin-ClientIP-Pluggable

 view release on metacpan or  search on metacpan

lib/Mojolicious/Plugin/ClientIP/Pluggable.pm  view on Meta::CPAN

    app->start;

=head1 DESCRIPTION

Mojolicious::Plugin::ClientIP::Pluggable is a Mojolicious plugin to get an IP address, which
allows to specify different HTTP-headers (and their priorities) for client IP address
extraction. This is needed as different cloud providers set different headers to disclose
real IP address.

If the address cannot be extracted from headers different fallback options are available:
detect IP address from C<X-Forwarded-For> header, detect IP address from C<forwarded> header
(rfc-7239), or use C<remote_address> environment.

The plugin is inspired by L<Mojolicious::Plugin::ClientIP>.

=head1 METHODS

=head2 client_ip

Find a client IP address from the specified headers, with optional fallbacks. The address is
validated that it is publicly available (aka routable) IP address. Empty string is returned



( run in 0.264 second using v1.01-cache-2.11-cpan-26ccb49234f )