[dancer-users] ip addess

Hermen Lesscher hermen at lesscher.org
Wed Apr 22 09:06:48 BST 2015


On 22/04/15 09:45, Hugues wrote:
> Hello
> I move my Dancer app from wpsgi to " starman + apache proxy"
>
> in my code, I registered client ip address with
>
> my $ip               = request->remote_address();
>
>
> now, Ip address is always 127.0.0.1
>
>
I generally use:

my $ip =  request->headers->{'x-forwarded-for'} || request->address();

(Dancer 1, though, don't know if it works in Dancer2)

Regards, Hermen

-- 
"I urge you to please notice when you are happy, and exclaim or murmur
or think at some point, 'If this isn't nice, I don't know what is.'"
                                                         -- Kurt Vonnegut



More information about the dancer-users mailing list