Viktor Turskyi > Mojolicious-Plugin-RemoteAddr > Mojolicious::Plugin::RemoteAddr

Download:
Mojolicious-Plugin-RemoteAddr-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Mojolicious::Plugin::RemoteAddr - an easy way of getting remote ip address

SYNOPSIS ^

  # Mojolicious
  $self->plugin('RemoteAddr');
  
  # In controller
  my $ip = $self->remote_addr;

DESCRIPTION ^

Mojolicious::Plugin::RemoteAddr adds simple helper "remote_addr" which returns an ip address of a remote host, It tries getting remote ip in different ways. Firstly, it takes 'X-Real-IP' header. If it is empty it takes the ip from current request transaction.

CONFIG ^

order

Lookup order. Default is ['x-real-ip', 'tx']

Supported places:

'x-real-ip'

'X-Real-IP' request header

'tx'

current request transaction

HELPERS ^

remote_addr

Returns remote IP address

AUTHOR ^

Viktor Turskyi <koorchik@cpan.org>

BUGS ^

Please report any bugs or feature requests to Github https://github.com/koorchik/Mojolicious-Plugin-RemoteAddr

SEE ALSO ^

Mojolicious, Mojolicious::Guides, http://mojolicio.us.

syntax highlighting: