Result:
found 109 distributions and 256 files matching your query ! ( run in 0.572 )


AWS-Lambda

 view release on metacpan or  search on metacpan

t/testdata/apigateway-base64-request.json  view on Meta::CPAN

        "accept": "*/*",
        "content-type": "application/octet-stream",
        "Host": "xxxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com",
        "User-Agent": "curl/7.54.0",
        "X-Amzn-Trace-Id": "Root=1-5c0f0502-7611e42628aee5c8cce21a72",
        "X-Forwarded-For": "192.0.2.1",
        "X-Forwarded-Port": "443",
        "X-Forwarded-Proto": "https"
    },
    "multiValueHeaders": {
        "accept": [

t/testdata/apigateway-base64-request.json  view on Meta::CPAN

            "curl/7.54.0"
        ],
        "X-Amzn-Trace-Id": [
            "Root=1-5c0f0502-7611e42628aee5c8cce21a72"
        ],
        "X-Forwarded-For": [
            "192.0.2.1"
        ],
        "X-Forwarded-Port": [
            "443"
        ],

 view all matches for this distribution


Apache-AuthCASSimple

 view release on metacpan or  search on metacpan

lib/Apache/AuthCASSimple.pm  view on Meta::CPAN

        $r->log()->warn(__PACKAGE__.": Session TimeOut !");
        $s->delete_session();
        return "";
    };

  my $ip = ($cfg->{_mod_proxy})?$r->header_in('X-Forwarded-For'):$r->connection->remote_ip();


  if($s->session->{'CASIP'} ne $ip) {
    $r->log()->warn(__PACKAGE__.": Remote IP Address changed along requests !");
    $s->delete_session();

lib/Apache/AuthCASSimple.pm  view on Meta::CPAN

    $r->log()->warn(__PACKAGE__.": Unable to create session for ".$r->connection->user().".");
    return;
  }

  $s->session->{'CASUser'} = $r->connection->user();
  my $ip = ($cfg->{_mod_proxy})?$r->header_in('X-Forwarded-For'):$r->connection->remote_ip();
  $s->session->{'CASIP'} = $ip;
  $s->session->{'time'} = time();

};

 view all matches for this distribution


Apache-AxKit-Plugin-Session

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Plugin/Session.pm  view on Meta::CPAN

    my $auth_name = $r->auth_name || 'AxKitSession';
    $self->debug(3,"--------- _get_session(".join(',',@_).")");
    my $dir = $r->dir_config($auth_name.'Dir') || '/tmp/sessions';
    my $expire = ($r->dir_config($auth_name.'Expire') || 30) / 5 + 1; #/
    my $check = $r->dir_config($auth_name.'IPCheck');
    my $remote = ($check == 1?($r->header_in('X-Forwarded-For') || $r->connection->remote_ip):
        $check == 2?($r->connection->remote_ip =~ m/(.*)\./):
        $check == 3?($r->connection->remote_ip):
        '');
    my $guest = $r->dir_config($auth_name.'Guest') || 'guest';

lib/Apache/AxKit/Plugin/Session.pm  view on Meta::CPAN


    PerlSetVar AxKitSessionIPCheck 1

Beware that IP checking is dangerous: Some people have different IP addresses
for each request, AOL customers for example. There are several values for you
to choose: 0 = no check; 1 = use numeric IP address or X-Forwarded-For, if present;
2 = use numeric IP address with last part stripped (/24 subnet); 3 = use
numeric IP address

=head2 Cookie options

lib/Apache/AxKit/Plugin/Session.pm  view on Meta::CPAN

=item * AxKitSessionIPCheck

The level of IP matching in sessions. A session id is only valid when the
connection is coming from the same remote address. This setting lets you
adjust what will be checked: 0 = nothing, 1 = numeric IP address or
HTTP X-Forwarded-For header, if present, 2 = numeric IP address with last
part stripped off, 3 = whole numeric IP address.

Example: PerlSetVar AxKitSessionIPCheck 3

=back

 view all matches for this distribution


Apache-CIPP

 view release on metacpan or  search on metacpan

CIPP.pm  view on Meta::CPAN

%Apache::CIPP::compiled = ();

sub handler {
	my $r = shift;
	
	# should we mangle remote_ip with proxy X-Forwarded-For?
	# (thanks to Ask Bjoern Hansen for his mod_proxy_add_forward.c.
	#  this code snippet is stolen from his documentation ;)

	if ( $r->dir_config ("mangle_proxy_remote_ip") ) {
		if ( $r->connection->remote_ip eq '127.0.0.1' ) {
			if ( my ($ip) = $r->header_in('X-Forwarded-For') =~
				/([^,\s]+)$/ ) {
				$r->connection->remote_ip($ip);
			}
		}
	}

 view all matches for this distribution


Apache-ForwardedFor

 view release on metacpan or  search on metacpan

lib/Apache/ForwardedFor.pm  view on Meta::CPAN


sub handler {

    my $r = shift;

    my $fwd_ips = $r->header_in('X-Forwarded-For');
    # $TRACE && warn(__PACKAGE__." bypassed - no X-Forward-For header") and
    return DECLINED unless $fwd_ips;

    # warn(__PACKAGE__." X-Forwarded-For header: $fwd_ips") if $TRACE;

    # Block based on Remove / Add AcceptForwarder values
    my %deny =map { $_ => 1 } $r->dir_config->get('ForwardedForDeny');
    if (exists $deny{$r->connection->remote_ip}) {
        # warn(__PACKAGE__." handling for IP ".$r->connection->remote_ip." refused by RemoveAcceptForwarder directive") if $TRACE;

lib/Apache/ForwardedFor.pm  view on Meta::CPAN



=head1 NAME

Apache::ForwardedFor - Re-set remote_ip to incoming client's ip when running mod_perl behind a reverse proxy server. 
In other words, copy the first IP from B<X-Forwarded-For> header, which was set by your reverse proxy server, 
to the B<remote_ip> connection property.

=head1 SYNOPSIS

  in httpd.conf

lib/Apache/ForwardedFor.pm  view on Meta::CPAN

  My IP           My IP               My IP
   2.3.4.5         2.9.1.2             192.168.1.2
                  remote_ip           remote_ip
                   2.3.4.5             2.3.4.5

This program takes advantage of the existance of the X-Forwarded-For
or header which is automatically added by software such as mod_proxy and Squid.
Obviously you can imagine that if a savvy user sets their own X-Forwarded-For
header that they could potentially be considered coming from a trusted
IP.

To ensure some measure of security: 1 - make sure you can trust the 
httpd/proxy machine (ie/ its in your organization); 2 - set this module to 
accept X-Forwarded-For headers only from this machine.

From my understanding of the X-Forwarded-For header - each proxy server
will prepend the remote_ip to this header. That means that if the request passes
through several proxies we want to pick up only the last proxy's change - which
is the first IP found in this header.

=head1 USAGE

lib/Apache/ForwardedFor.pm  view on Meta::CPAN


Please report your bugs and suggestions for improvement to 
info@infonium.com ... For faster service please in
clude "Apache::ForwardedFor" and "bug" in your subject line.

I have not yet found written documentation on the usage of the X-Forwarded-For
header. My implementation assumes that the first IP in the incoming header
is for your (the most recent) proxy server.

=head1 SUPPORT

 view all matches for this distribution


Apache-GeoIP

 view release on metacpan or  search on metacpan

Apache/Geo/IP.pm  view on Meta::CPAN

This specifies the type of database file to be used. See the L<Geo::IP> documentation
for the various types that are supported.

=item PerlSetVar GeoIPXForwardedFor 1

If this directive is set to something true, the I<X-Forwarded-For> header will
be used to try to identify the originating IP address; this is useful for clients 
connecting to a web server through an HTTP proxy or load balancer. If this header
is not present, C<$r-E<gt>connection-E<gt>remote_ip> will be used.

=back

Apache/Geo/IP.pm  view on Meta::CPAN


=item $code = $r->country_code_by_addr( [$ipaddr] );

Returns the ISO 3166 country code for an IP address.
If I<$ipaddr> is not given, the value obtained by
examining the I<X-Forwarded-For> header will be used, if
I<GeoIPXForwardedFor> is used, or else
C<$r-E<gt>connection-E<gt>remote_ip> is used

=item $code = $r->country_code_by_name( [$ipname] );

Apache/Geo/IP.pm  view on Meta::CPAN


=item $code = $r->country_code3_by_addr( [$ipaddr] );

Returns the 3 letter country code for an IP address.
If I<$ipaddr> is not given, the value obtained by
examining the I<X-Forwarded-For> header will be used, if
I<GeoIPXForwardedFor> is used, or else
C<$r-E<gt>connection-E<gt>remote_ip> is used.

=item $code = $r->country_code3_by_name( [$ipname] );

Apache/Geo/IP.pm  view on Meta::CPAN


=item $org = $r->org_by_addr( [$ipaddr] );

Returns the Organization, ISP name or Domain Name for an IP address.
If I<$ipaddr> is not given, the value obtained by
examining the I<X-Forwarded-For> header will be used, if
I<GeoIPXForwardedFor> is used, or else
C<$r-E<gt>connection-E<gt>remote_ip> is used.

=item $org = $r->org_by_name( [$ipname] );

Apache/Geo/IP.pm  view on Meta::CPAN

=item ( $country, $region ) = $r->region_by_addr( [$ipaddr] );

Returns a list containing country and region for an IP address. If the
region and/or country is unknown, I<undef> is returned. This works only 
for region databases. If I<$ipaddr> is not given, the value obtained by
examining the I<X-Forwarded-For> header will be used, if
I<GeoIPXForwardedFor> is used, or else
C<$r-E<gt>connection-E<gt>remote_ip> is used.

=item ( $country, $region ) = $r->region_by_name( [$ipname] );

Returns a list containing country and region for a hostname. If the
region and/or country is unknown, I<undef> is returned. This works only 
for region databases. If I<$ipname> is not given, the value obtained by
examining the I<X-Forwarded-For> header will be used, if
I<GeoIPXForwardedFor> is used, or else
C<$r-E<gt>get_remote_host(REMOTE_HOST)> is used.

=item $gi = $r->gi

Apache/Geo/IP.pm  view on Meta::CPAN


=item $record = $r->record_by_addr( [$ipaddr] );

Returns a L<Geo::IP::Record> object containing city location an IP address.
If I<$ipaddr> is not given, the value obtained by
examining the I<X-Forwarded-For> header will be used, if
I<GeoIPXForwardedFor> is used, or else
C<$r-E<gt>connection-E<gt>remote_ip> is used.

=item $record = $r->record_by_name( [$ipname] );

 view all matches for this distribution


Apache-HeavyCGI

 view release on metacpan or  search on metacpan

lib/Apache/HeavyCGI/SquidRemoteAddr.pm  view on Meta::CPAN



sub handler {
  my $r = shift;

  my $xff = $r->header_in('X-Forwarded-For')||"";
  if (my($ip) = $xff =~ /([^,\s]+)$/) {
    $r->connection->remote_ip($ip);
  } else {
    warn sprintf "No IP in X-Forwarded-For[%s]", $xff
	unless $NoHeader_warned++;
  }
  warn sprintf "HERE Headers[%s]", join " ", $r->headers_in if SRA_DEBUG;

  DECLINED;

lib/Apache/HeavyCGI/SquidRemoteAddr.pm  view on Meta::CPAN


__END__

=head1 NAME

Apache::HeavyCGI::SquidRemoteAddr - Pass X-Forwarded-For Header through as remote_ip

=head1 SYNOPSIS

 PerlPostReadRequestHandler  Apache::HeavyCGI::SquidRemoteAddr

 view all matches for this distribution


Apache-PageKit

 view release on metacpan or  search on metacpan

lib/Apache/ErrorReport.pm  view on Meta::CPAN

    $uri .= '?' . $r->notes('query_string') if $uri !~ /\?/;

    my $userID = $r->connection->user;

    my $host = $r->header_in('Host');
    my $remote_host = $r->header_in('X-Forwarded-For') || $r->get_remote_host;
    my $referer = $r->header_in('Referer');

    my $current_callback = $r->current_callback;

    my $message = <<END;

 view all matches for this distribution


Apache-iNcom

 view release on metacpan or  search on metacpan

demo/conf/startup.pl  view on Meta::CPAN

# Other stuff
# Reinstall remote address if the request was proxied
sub My::ProxyRemoteAddr ($) {
  my $r = shift;

  # we'll only look at the X-Forwarded-For header if the requests
  # comes from our proxy at localhost
  return OK unless ($r->connection->remote_ip eq "127.0.0.1");

  if (my ($ip) = $r->header_in('X-Forwarded-For') =~ /([^,\s]+)$/) {
    $r->connection->remote_ip($ip);
  }
  return OK;
}

 view all matches for this distribution


Apache2-AuthCASSimple

 view release on metacpan or  search on metacpan

lib/Apache2/AuthCASSimple.pm  view on Meta::CPAN

    
    };

    return "" unless(defined $s);
  
    my $ip = ($mod_proxy)?$r->headers_in->{'X-Forwarded-For'}:$r->connection->remote_ip();
    my $user = $s->session->{'CASUser'} || 'empty cookie';

    my $session_time = $s->session->{'time'} || 0;

    if ($cas_session_timeout && $session_time + $cas_session_timeout < time) {

lib/Apache2/AuthCASSimple.pm  view on Meta::CPAN

  }

  $r->log()->info(__PACKAGE__.": Session id ".$s->{session_id});

  $s->session->{'CASUser'} = $r->user();
  my $ip = ($mod_proxy)?$r->headers_in->{'X-Forwarded-For'}:$r->connection->remote_ip();
  $s->session->{'CASIP'} = $ip;
  $s->session->{'time'} = time();

};

 view all matches for this distribution


Apache2-Connection-XForwardedFor

 view release on metacpan or  search on metacpan

lib/Apache2/Connection/XForwardedFor.pm  view on Meta::CPAN

use strict;
use warnings;

=head1 NAME

Apache2::Connection::XForwardedFor - Sets the connection remote_ip to X-Forwarded-For header

=head1 SYNOPSIS

 PerlPostReadRequestHandler Apache2::Connection::XForwardedFor

lib/Apache2/Connection/XForwardedFor.pm  view on Meta::CPAN


 $client_ip = $r->connection->remote_ip;

=head1 DESCRIPTION

This simple module takes the X-Forwarded-For header value and sets the
remote_ip attribute of the connection object with that ip.  This module is
meant to be used with reverse proxies where the proxy sets the header to the
ip of the http client.

This module doesn't have any fancy features like similar modules, it is meant

lib/Apache2/Connection/XForwardedFor.pm  view on Meta::CPAN


sub handler {
    my $r = shift;

    # unset the X-Forwarded header and set the connection remote_ip
    if ( defined $r->headers_in->{'X-Forwarded-For'} ) {
        $r->connection->remote_ip( $r->headers_in->{'X-Forwarded-For'} );
        $r->headers_in->unset('X-Forwarded-For');
    }

    return Apache2::Const::DECLINED;
}

 view all matches for this distribution


Apache2-FixRemote

 view release on metacpan or  search on metacpan

lib/Apache2/FixRemote.pm  view on Meta::CPAN


use APR::Table  ();

=head1 NAME

Apache2::FixRemote - Reset remote IP with contents of X-Forwarded-For header

=head1 VERSION

Version 0.01

lib/Apache2/FixRemote.pm  view on Meta::CPAN


=cut

sub handler {
    my $r = shift;
    my $hdr = $r->headers_in->get('X-Forwarded-For');
    if ($hdr and $hdr =~ /^\d+\.\d+\.\d+\.\d+$/) {
        my $old = $r->connection->remote_ip($hdr);
        $r->log->debug("Changed inbound IP from $old to $hdr");
    }
    Apache2::Const::OK;

 view all matches for this distribution


Apache2-PageKit

 view release on metacpan or  search on metacpan

lib/Apache2/ErrorReport.pm  view on Meta::CPAN


    my $userID = $r->user;

    my $headers_in = $r->headers_in;
    my $host = $headers_in->{'Host'};
    my $remote_host = $headers_in->{'X-Forwarded-For'} || $r->get_remote_host;
    my $referer = $headers_in->{'Referer'};

    my $current_callback = $r->current_callback;

    my $message = <<END;

 view all matches for this distribution


Apache2-xForwardedFor

 view release on metacpan or  search on metacpan

lib/Apache2/xForwardedFor.pm  view on Meta::CPAN

sub handler {
	my 	( $r )= shift;
	return DECLINED if $r->uri eq '/favicon.ico';
	DEBUG && print STDERR "\n============================ Apache2::xForwardedFor";

	my 	$x_forwarded_for__header_name= $r->dir_config->get('xForwardedForAlternateHeaderName') || 'X-Forwarded-For' ;
	my 	$require_header= $r->dir_config->get('xForwardedForRequire') || undef;
	
	# for testing purposes, toss in a local header value
	TEST && $r->headers_in->set( $x_forwarded_for__header_name=> '10.0.1.140' );
	my 	$x_forwarded_for__header_value= $r->headers_in->{ $x_forwarded_for__header_name };

lib/Apache2/xForwardedFor.pm  view on Meta::CPAN

};

=head1 NAME

Apache2::xForwardedFor - Re-set remote_ip to incoming client's ip when running mod_perl behind a reverse proxy server. 
In other words, copy the first IP from B<X-Forwarded-For> header, which was set by your reverse proxy server, 
to the B<remote_ip> connection property.

=head1 SYNOPSIS

  in httpd.conf

lib/Apache2/xForwardedFor.pm  view on Meta::CPAN


=head1 DESCRIPTION

Apache2::xForwardedFor will let you do all this neat stuff

  migrate X-Forwarded-For headers into $c->remote_ip for proxied requests
  specify which reverse proxy servers your mod_perl app serves to using:
     a list of IPs you allow
     a list of IPs you prohibit
     a secondary header of your choice, with a set value , inserted by the reverse proxy

lib/Apache2/xForwardedFor.pm  view on Meta::CPAN


=head2 Variables

=head3 xForwardedForAlternateHeaderName

should you want to receive the X-Forwarded-For info from the proxy server on another ip, the name of it would be the value of this variable.

=head3 xForwardedForRequire

require the X-Forwarded-For header (or alternate name).  return FORBIDDEN otherwise

Why would you do this?  So that by default you can use either access apache through the proxy or directly.  This is FALSE by default, if someone wants to patch to be TRUE by default, send it my way. 

=head3 xForwardedForRequireHeaderName

 view all matches for this distribution


App-Ikachan

 view release on metacpan or  search on metacpan

lib/App/Ikachan.pm  view on Meta::CPAN


irc user name

=item -r, --reverse-proxy

treat X-Forwarded-For as REMOTE_ADDR if REMOTE_ADDR match this argument.

see L<Plack::Middleware::ReverseProxy>.

=item -i, --interval

 view all matches for this distribution


App-MHFS

 view release on metacpan or  search on metacpan

lib/App/MHFS.pm  view on Meta::CPAN

        if($self->{'client'}{'X-MHFS-PROXY-KEY'} && $self->{'header'}{'X-MHFS-PROXY-KEY'}) {
            $trusted = $self->{'client'}{'X-MHFS-PROXY-KEY'} eq $self->{'header'}{'X-MHFS-PROXY-KEY'};
        }
        # drops conns for naughty client's using forbidden headers
        if(!$trusted) {
            my @absolutelyforbidden = ('X-MHFS-PROXY-KEY', 'X-Forwarded-For');
            foreach my $forbidden (@absolutelyforbidden) {
                if( exists $self->{'header'}{$forbidden}) {
                    say "header $forbidden is forbidden!";
                    return undef;
                }
            }
        }
        # process reverse proxy headers
        else {
            delete $self->{'header'}{'X-MHFS-PROXY-KEY'};
            $self->{'ip'} = MHFS::Util::ParseIPv4($self->{'header'}{'X-Forwarded-For'}) if($self->{'header'}{'X-Forwarded-For'});
        }
        my $netmap = $self->{'client'}{'server'}{'settings'}{'NETMAP'};
        if($netmap && (($self->{'ip'} >> 24) == $netmap->[0])) {
            say "HACK for netmap converting to local ip";
            $self->{'ip'} = ($self->{'ip'} & 0xFFFFFF) | ($netmap->[1] << 24);

 view all matches for this distribution


App-Phoebe

 view release on metacpan or  search on metacpan

lib/App/Phoebe/Oddmuse.pm  view on Meta::CPAN

  my $token = pop(@tokens); # the oddmuse wiki token, preferrably
  my $name = ref($stream->handle) eq 'IO::Socket::SSL' && $stream->handle->peer_certificate('cn') || "";
  my $ua = Mojo::UserAgent->new;
  my $tx = $ua->post(
    $oddmuse_wikis{$host}
    => {'X-Forwarded-For' => $stream->handle->peerhost}
    => form => {
      title => $id,
      text => $data,
      ns => $space,
      answer => $token,

lib/App/Phoebe/Oddmuse.pm  view on Meta::CPAN

sub oddmuse_get_raw {
  my $stream = shift;
  my $url = shift;
  $log->debug("Requesting $url");
  my $ua = Mojo::UserAgent->new;
  my $res = $ua->get($url => {'X-Forwarded-For' => $stream->handle->peerhost})->result;
  if ($res->is_success) {
    return $res->text;
  } elsif ($res->code == 404) {
    return "";
  }

lib/App/Phoebe/Oddmuse.pm  view on Meta::CPAN

  my $token = $oddmuse_wiki_tokens{$host};
  $token = $server->{wiki_token}->[0] if not $token and $server->{wiki_token};
  my $ua = Mojo::UserAgent->new;
  my $tx = $ua->post(
    $oddmuse_wikis{$host}
    => {'X-Forwarded-For' => $stream->handle->peerhost}
    => form => {
      title => $id,
      ns => $space,
      aftertext => $query,
      username => $name,

 view all matches for this distribution


App-TLSMe

 view release on metacpan or  search on metacpan

lib/App/TLSMe/Connection/http.pm  view on Meta::CPAN

use base 'App::TLSMe::Connection';

sub _on_send_handler {
    my $self = shift;

    my $x_forwarded_for   = "X-Forwarded-For: $self->{peer_host}\x0d\x0a";
    my $x_forwarded_proto = "X-Forwarded-Proto: https\x0d\x0a";

    my $headers;
    return sub {
        my $handle = shift;

 view all matches for this distribution


App-Tacochan

 view release on metacpan or  search on metacpan

lib/App/Tacochan.pm  view on Meta::CPAN

4969. This option doesn't mean anything if the server does not support
TCP socket.

=item -r, --reverse-proxy

treat X-Forwarded-For as REMOTE_ADDR if REMOTE_ADDR match this argument.

see L<Plack::Middleware::ReverseProxy>.

=item -h, --help

 view all matches for this distribution


App-phoebe

 view release on metacpan or  search on metacpan

lib/App/Phoebe/Oddmuse.pm  view on Meta::CPAN

  my $token = pop(@tokens); # the oddmuse wiki token, preferrably
  my $name = ref($stream->handle) eq 'IO::Socket::SSL' && $stream->handle->peer_certificate('cn') || "";
  my $ua = Mojo::UserAgent->new;
  my $tx = $ua->post(
    $oddmuse_wikis{$host}
    => {'X-Forwarded-For' => $stream->handle->peerhost}
    => form => {
      title => $id,
      text => $data,
      ns => $space,
      answer => $token,

lib/App/Phoebe/Oddmuse.pm  view on Meta::CPAN

sub oddmuse_get_raw {
  my $stream = shift;
  my $url = shift;
  $log->debug("Requesting $url");
  my $ua = Mojo::UserAgent->new;
  my $res = $ua->get($url => {'X-Forwarded-For' => $stream->handle->peerhost})->result;
  if ($res->is_success) {
    return $res->text;
  } elsif ($res->code == 404) {
    return "";
  }

lib/App/Phoebe/Oddmuse.pm  view on Meta::CPAN

  my $token = $oddmuse_wiki_tokens{$host};
  $token = $server->{wiki_token}->[0] if not $token and $server->{wiki_token};
  my $ua = Mojo::UserAgent->new;
  my $tx = $ua->post(
    $oddmuse_wikis{$host}
    => {'X-Forwarded-For' => $stream->handle->peerhost}
    => form => {
      title => $id,
      ns => $space,
      aftertext => $query,
      username => $name,

 view all matches for this distribution


AxKit-App-TABOO

 view release on metacpan or  search on metacpan

lib/AxKit/App/TABOO/XSP/Comment.pm  view on Meta::CPAN

      AxKit::Debug(4, "Using Akismet");
      my $akismet = Net::Akismet->new(
                        KEY => $r->dir_config('TABOOAkismetKey'),
                        URL => 'http://'.$r->header_in('X-Forwarded-Host'),
                ) or throw Apache::AxKit::Exception::Error(-text => "Akismet key verification failed.");
      my %akismetstuff = (USER_IP => $r->header_in('X-Forwarded-For'),
			  COMMENT_CONTENT => $args{'content'},
			  REFERRER => $r->header_in('Referer'),
			  COMMENT_TYPE => 'comment',
			 );
      if ($authlevel >= 2) { # Presumed ham

 view all matches for this distribution


Bio-Das-Lite

 view release on metacpan or  search on metacpan

lib/Bio/Das/Lite.pm  view on Meta::CPAN

  if(!$headers) {
    $headers = {};
  }

  if($ENV{HTTP_X_FORWARDED_FOR}) {
    $headers->{'X-Forwarded-For'} ||= $ENV{'HTTP_X_FORWARDED_FOR'};
  }
  $headers->{'X-DAS-Version'} ||= '1.6';

  # Convert header pairs to strings
  my @headers;

 view all matches for this distribution


Bio-Das-ProServer

 view release on metacpan or  search on metacpan

lib/Bio/Das/ProServer/Authenticator/ip.pm  view on Meta::CPAN

  my ($self, $params) = @_;

  # Reset stored IP
  delete $self->{'ip'};
  # IP addresses checked:
  # 1. All IPs from the X-Forwarded-For header
  # 2. The socket address
  my @query_ips = $params->{'request'} ? split /\s*,\s*/mxs, $params->{'request'}->header('X-Forwarded-For') : ();
  if ($params->{'peer_addr'}) {
    push @query_ips, inet_ntoa( $params->{'peer_addr'} );
  }
  @query_ips = map {
    Net::IP->new($_) || croak 'Unable to determine client IP: '.Net::IP::Error

lib/Bio/Das/ProServer/Authenticator/ip.pm  view on Meta::CPAN

Authenticates requests according to a 'whitelist' of IP address ranges. Requests
from clients not within one of these ranges are denied.

The IP addresses that are checked against the whitelist are:
  1) that of the socket connection
  2) those listed in the X-Forwarded-For HTTP header

The latter is necessary for clients and servers operating behind proxies.

IMPORTANT NOTE:
Because IP addresses can be spoofed by clients, this is NOT a robust method of

lib/Bio/Das/ProServer/Authenticator/ip.pm  view on Meta::CPAN

  Requires: a hash reference containing details of the DAS request
  Returns:  either nothing (allow) or a HTTP::Response (deny)

  my $allow = $oAuth->authenticate({
    'peer_addr' => $, # packed (socket IP address)
    'request'   => $, # HTTP::Request object (for X-Forwarded-For header)
    ...
  });

=head2 ip : Gets the authenticated IP address

lib/Bio/Das/ProServer/Authenticator/ip.pm  view on Meta::CPAN

=back

=head1 BUGS AND LIMITATIONS

Clients that are separated from the server by an anonymising HTTP proxy (i.e.
one that does not reveal the client's IP address in the X-Forwarded-For HTTP
header) will always fail this method of authentication.

Note that clients may spoof an IP address in the X-Forwarded-For header.
Therefore this method of authentication is not a robust security precaution.

=head1 INCOMPATIBILITIES

None reported.

 view all matches for this distribution


Bot-Pastebot

 view release on metacpan or  search on metacpan

lib/Bot/Pastebot/Server/Http.pm  view on Meta::CPAN

      defined $channel or $channel = "";
      $channel =~ tr[\x00-\x1F\x7F][]d;

      my $remote_addr = $heap->{remote_addr};
      if ($heap->{my_proxy} && $remote_addr eq $heap->{my_proxy}) {
        # apache sets the X-Forwarded-For header to a list of the
        # IP addresses that were forwarded from/to
        my $forwarded = $request->headers->header('X-Forwarded-For');
        if ($forwarded) {
          ($remote_addr) = $forwarded =~ /([^,\s]+)$/;
        }
        # else must be local?
      }

 view all matches for this distribution


CAPE-Utils

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

      force-hash: [sha1, md5]
      xff:
        enabled: no
        mode: extra-data
        deployment: reverse
        header: X-Forwarded-For
```

### CAPE::Utils

The default config file is '/usr/local/etc/cape_utils.ini'.

 view all matches for this distribution


CGI-Application-Plugin-RemoteIP

 view release on metacpan or  search on metacpan

lib/CGI/Application/Plugin/RemoteIP.pm  view on Meta::CPAN


=cut

=head1 SECURITY

The code in this module will successfully understand the C<X-Forwarded-For>
header and B<trust> it.

Unless you have setup any proxy, or webserver, to scrub this header this means
the value that is used is at risk of being spoofed, bogus, or otherwise
malicious.

lib/CGI/Application/Plugin/RemoteIP.pm  view on Meta::CPAN

}


=head2 remote_ip

Return the remote IP of the visitor, whether via the C<X-Forwarded-For> header
or via the standard CGI environmental variable C<REMOTE_ADDR>.

=cut

sub remote_ip
{
    my $cgi_app = shift;

    # X-Forwarded-For header is the first thing we look for.
    my $forwarded = $ENV{ 'HTTP_X_FORWARDED_FOR' } || "";
    if ( length $forwarded )
    {

        # Split in case there are multiple values

 view all matches for this distribution


CLI-Meta-YoutubeDl

 view release on metacpan or  search on metacpan

devdata/youtube-dl.help.2019.07.16  view on Meta::CPAN

    -6, --force-ipv6                 Make all connections via IPv6

  Geo Restriction:
    --geo-verification-proxy URL     Use this proxy to verify the IP address for some geo-restricted sites. The default proxy specified by --proxy (or none, if the option is not present) is used
                                     for the actual downloading.
    --geo-bypass                     Bypass geographic restriction via faking X-Forwarded-For HTTP header
    --no-geo-bypass                  Do not bypass geographic restriction via faking X-Forwarded-For HTTP header
    --geo-bypass-country CODE        Force bypass geographic restriction with explicitly provided two-letter ISO 3166-2 country code
    --geo-bypass-ip-block IP_BLOCK   Force bypass geographic restriction with explicitly provided IP block in CIDR notation

  Video Selection:
    --playlist-start NUMBER          Playlist video to start at (default is 1)

 view all matches for this distribution


CLI-Meta-YtDlp

 view release on metacpan or  search on metacpan

devdata/youtube-dl.help.2019.07.16  view on Meta::CPAN

    -6, --force-ipv6                 Make all connections via IPv6

  Geo Restriction:
    --geo-verification-proxy URL     Use this proxy to verify the IP address for some geo-restricted sites. The default proxy specified by --proxy (or none, if the option is not present) is used
                                     for the actual downloading.
    --geo-bypass                     Bypass geographic restriction via faking X-Forwarded-For HTTP header
    --no-geo-bypass                  Do not bypass geographic restriction via faking X-Forwarded-For HTTP header
    --geo-bypass-country CODE        Force bypass geographic restriction with explicitly provided two-letter ISO 3166-2 country code
    --geo-bypass-ip-block IP_BLOCK   Force bypass geographic restriction with explicitly provided IP block in CIDR notation

  Video Selection:
    --playlist-start NUMBER          Playlist video to start at (default is 1)

 view all matches for this distribution



Catalyst-Engine-Apache

 view release on metacpan or  search on metacpan

lib/Catalyst/Engine/Apache.pm  view on Meta::CPAN

        my $headers = $self->apache->headers_in;
        unless ( $c->config->{using_frontend_proxy} ) {
            last PROXY_CHECK if $c->request->address ne '127.0.0.1';
            last PROXY_CHECK if $c->config->{ignore_frontend_proxy};
        }
        last PROXY_CHECK unless $headers->{'X-Forwarded-For'};

        # If we are running as a backend server, the user will always appear
        # as 127.0.0.1. Select the most recent upstream IP (last in the list)
        my ($ip) = $headers->{'X-Forwarded-For'} =~ /([^,\s]+)$/;
        $c->request->address( $ip );
    }

    $c->request->hostname( $self->apache->connection->remote_host );
    $c->request->protocol( $self->apache->protocol );

 view all matches for this distribution


( run in 0.572 second using v1.01-cache-2.11-cpan-26ccb49234f )