[dancer-users] ip addess
Stefan Hornburg (Racke)
racke at linuxia.de
Thu Apr 23 08:36:28 BST 2015
On 04/23/2015 09:34 AM, Hugues wrote:
> yes but request->headers->{'x-forwarded-for'} can be
>
> address client, adresse proxy1, adresse proxy2 etc...
> |
> x-forwarded-for":"65.28.225.84, 54.240.144.193"
>
That's why it is better to use the Plack middleware :-).
Regards
Racke
> |
> Le 22/04/2015 10:06, Hermen Lesscher a écrit :
>> 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
>>
>
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
--
Modern Perl, Dancer and eCommerce consulting.
More information about the dancer-users
mailing list