Any-Daemon-HTTP

 view release on metacpan or  search on metacpan

lib/Any/Daemon/HTTP/Proxy.pod  view on Meta::CPAN

=encoding utf8

=head1 NAME

Any::Daemon::HTTP::Proxy - proxy request to a remote server

=head1 INHERITANCE

 Any::Daemon::HTTP::Proxy
   is an Any::Daemon::HTTP::Source

=head1 SYNOPSIS

 my $proxy = Any::Daemon::HTTP::Proxy->new(path => '/forward');

 my $vh = Any::Daemon::HTTP::VirtualHost->new(proxies => $proxy);

=head1 DESCRIPTION

[Available since v0.24] B<Warning: new code, not intensively tested.>

There are two kinds of proxies:

=over 4

=item 1.

Each L<Any::Daemon::HTTP::VirtualHost|Any::Daemon::HTTP::VirtualHost> may define as many proxies as it
needs: selected by location inside a virtual host namespace, just like other
directories.  These requests are forwarded to some proxy server.

=item 2.

The HTTP daemon itself collects proxies which use C<forward_map>'s; mapping
incoming requests for (one or) many domains to (one or) many destinations.

=back

The current implementation does not support all features of proxies.
For instance, it does not combine incoming connections into new
outgoing connections.  You may take a look at IOMux::HTTP::Gateway
for that.

Proxy loop detection is used by adding C<Via> header fields (which
can be removed explicitly).

Extends L<"DESCRIPTION" in Any::Daemon::HTTP::Source|Any::Daemon::HTTP::Source/"DESCRIPTION">.
 
=head1 METHODS

Extends L<"METHODS" in Any::Daemon::HTTP::Source|Any::Daemon::HTTP::Source/"METHODS">.
 
=head2 Constructors

Extends L<"Constructors" in Any::Daemon::HTTP::Source|Any::Daemon::HTTP::Source/"Constructors">.
 
=over 4

=item Any::Daemon::HTTP::Proxy-E<gt>B<new>(%options|\%options)

A proxy has either a C<path> various, in which case it is part of
a single VirtualHost, or has a C<forward_map> when it becomes a child
of the http daemon itself.

 -Option            --Defined in               --Default
  add_req_headers                                []
  add_resp_headers                               []
  allow               Any::Daemon::HTTP::Source  <undef>
  change_request                                 undef
  change_response                                undef
  deny                Any::Daemon::HTTP::Source  <undef>
  forward_map                                    <undef>
  forward_timeout                                100
  name                Any::Daemon::HTTP::Source  path
  path                Any::Daemon::HTTP::Source  '/'
  remote_proxy                                   undef
  reverse                                        true
  strip_req_headers                              []
  strip_resp_headers                             []
  user_agent                                     undef



( run in 0.879 second using v1.01-cache-2.11-cpan-39bf76dae61 )