Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

IP

by sOKOle (Acolyte)
on Aug 14, 2001 at 14:08 UTC ( [id://104720]=perlquestion: print w/replies, xml ) Need Help??

sOKOle has asked for the wisdom of the Perl Monks concerning the following question:

To check user IP we have the enviroment table $ENV: $address=$ENV{REMOTE_ADDR}; but if the user connects through LAN his IP is always 127.0.0.1 Does anybody knows what should I do to get the user real IP, even when he connects through LAN? RSVP sOKOle

Replies are listed 'Best First'.
Re: IP
by blakem (Monsignor) on Aug 14, 2001 at 14:35 UTC
    There are various setups that will cause the remote_addr to be the local machine (127.0.0.1). Most that I've seen will set some other environment variable before overwriting $ENV{REMOTE_ADDR}, You might try $ENV{HTTP_PROXY} $ENV{FORWARDED_FOR} or $ENV{X_HTTP_FORWARD}. Since it varies between systems, my advice would be to just dump your %ENV and take a look, like so:

    print "$_ => $ENV{$_}\n" for (keys %ENV);

    -Blake

Re: IP addresses
by RatArsed (Monk) on Aug 14, 2001 at 14:17 UTC
    Are your users connecting via a proxy, on the same host? the remote address is always the IP address of the remote socket.

    --
    RatArsed

      via a proxy I think, anyway the problem remains, regardles how do they connect I always see the same :( sOKOle

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://104720]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found