[dancer-users] ip addess

Marco Pessotto melmothx at gmail.com
Wed Apr 22 12:28:39 BST 2015


Hugues <hugues at max4mail.com> writes:

> Thanks Paulo and Stefan
>
> I change my code to:
>
> my $ip;
>
>                 if ( request->remote_address() eq "127.0.0.1" ) {
>                         $ip = request->header('x-forwarded-for');
>                 } else {
>                         $ip = request->remote_address();
>                 }
>
>                 debug "My ip : ". $ip;
>
>
> it's ok now
>

Try to load Plack::Middleware::ReverseProxy, which should do the trick.


-- 
Marco


More information about the dancer-users mailing list