Do not proxy requests to the given domains. Calling no_proxy without
any domains clears the list of domains. Eg:
$ua->no_proxy('localhost', 'no', ...);
=item $ua->env_proxy
Load proxy settings from *_proxy environment variables. You might
specify proxies like this (sh-syntax):
gopher_proxy=http://proxy.my.place/
wais_proxy=http://proxy.my.place/
no_proxy="localhost,my.domain"
export gopher_proxy wais_proxy no_proxy
csh or tcsh users should use the C<setenv> command to define these
environment variables.
On systems with case insensitive environment variables there exists a
name clash between the CGI environment variables and the C<HTTP_PROXY>
environment variable normally picked up by env_proxy(). Because of
this C<HTTP_PROXY> is not honored for CGI scripts. The
C<CGI_HTTP_PROXY> environment variable can be used instead.
=back
=head2 Handlers
Handlers are code that injected at various phases during the
processing of requests. The following methods are provided to manage
the active handlers:
=over
=item $ua->add_handler( $phase => \&cb, %matchspec )
Add handler to be invoked in the given processing phase. For how to
specify %matchspec see L<HTTP::Config/"Matching">.
The possible values $phase and the corresponding callback signatures are:
=over
=item request_preprepare => sub { my($request, $ua, $h) = @_; ... }
The handler is called before the C<request_prepare> and other standard
initialization of of the request. This can be used to set up headers
and attributes that the C<request_prepare> handler depends on. Proxy
initialization should take place here; but in general don't register
handlers for this phase.
=item request_prepare => sub { my($request, $ua, $h) = @_; ... }
The handler is called before the request is sent and can modify the
request any way it see hit. This can for instance be used to add
certain headers to specific requests.
The method can assign a new request object to $_[0] to replace the
request that is sent fully.
The return value from the callback is ignored. If an exceptions is
raised it will abort the request and make the request method return a
"400 Bad request" response.
=item request_send => sub { my($request, $ua, $h) = @_; ... }
This handler get a chance of handling requests before it's sent to the
protocol handlers. It should return an HTTP::Response object if it
wishes to terminate the processing; otherwise it should return nothing.
The C<response_header> and C<response_data> handlers will not be
invoked for this response, but the C<response_done> will be.
=item response_header => sub { my($response, $ua, $h) = @_; ... }
This handler is called right after the response headers have been
received, but before any content data. The handler might set up
handlers for data and might croak to abort the request.
The handler might set the $response->{default_add_content} value to
control if any received data should be added to the response object
directly. This will initially be false if the $ua->request() method
was called with a ':content_filename' or ':content_callbak' argument;
otherwise true.
=item response_data => sub { my($response, $ua, $h, $data) = @_; ... }
This handlers is called for each chunk of data received for the
response. The handler might croak to abort the request.
This handler need to return a TRUE value to be called again for
subsequent chunks for the same request.
=item response_done => sub { my($response, $ua, $h) = @_; ... }
The handler is called after the response has been fully received, but
before any redirect handling is attempted. The handler can be used to
extract information or modify the response.
=14= |