laziness, impatience, and hubris | |
PerlMonks |
Re: REMOTE_ADDR not workingby Jeppe (Monk) |
on May 03, 2017 at 07:42 UTC ( [id://1189390]=note: print w/replies, xml ) | Need Help?? |
REMOTE_ADDR breaks when there is a proxy involved. A better way is to first check for X-FORWARDED-FOR in the HTTP headers using $q->http('X-FORWARDED-FOR'). Proxies should set this field. Take note that there may be several comma-separated entries in that field. If that field is not set, get the IP from REMOTE_ADDR.
In Section
Seekers of Perl Wisdom
|
|