Help for this page

Select Code to Download


  1. or download this
    X-Forwarded-For: client, proxy1, proxy2,.....
    
  2. or download this
        my $ip = $ENV{'HTTP_X_FORWARDED_FOR'} || $ENV{'REMOTE_HOST'} || $E
    +NV{'REMOTE_ADDR'};
        # HTTP_X_FORWARDED_FOR may be 'xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx'
        # originating client is left most IP. this split patches issues as
    + some proxies
        # add space after IP and before ,
        ($ip) = split /\s*,/, $ip;