AnyEvent-HTTP
view release on metacpan or search on metacpan
of other settings, such as C<tcp_connect> or C<proxy>). Sometimes (e.g.
when using TLS or a specfic proxy), you do not want to reuse connections
from other sessions. This can be achieved by setting this parameter to
some unique ID (such as the address of an object storing your state data
or the TLS context, or the proxy IP) - only connections using the same
unique ID will be reused.
=item on_prepare => $callback->($fh)
In rare cases you need to "tune" the socket before it is used to
connect (for example, to bind it on a given IP address). This parameter
overrides the prepare callback passed to C<AnyEvent::Socket::tcp_connect>
and behaves exactly the same way (e.g. it has to provide a
timeout). See the description for the C<$prepare_cb> argument of
C<AnyEvent::Socket::tcp_connect> for details.
=item tcp_connect => $callback->($host, $service, $connect_cb, $prepare_cb)
In even rarer cases you want total control over how AnyEvent::HTTP
establishes connections. Normally it uses L<AnyEvent::Socket::tcp_connect>
to do this, but you can provide your own C<tcp_connect> function -
(regardless of other settings, such as "tcp_connect" or
"proxy"). Sometimes (e.g. when using TLS or a specfic proxy),
you do not want to reuse connections from other sessions. This
can be achieved by setting this parameter to some unique ID
(such as the address of an object storing your state data or the
TLS context, or the proxy IP) - only connections using the same
unique ID will be reused.
on_prepare => $callback->($fh)
In rare cases you need to "tune" the socket before it is used to
connect (for example, to bind it on a given IP address). This
parameter overrides the prepare callback passed to
"AnyEvent::Socket::tcp_connect" and behaves exactly the same way
(e.g. it has to provide a timeout). See the description for the
$prepare_cb argument of "AnyEvent::Socket::tcp_connect" for
details.
tcp_connect => $callback->($host, $service, $connect_cb,
$prepare_cb)
In even rarer cases you want total control over how
AnyEvent::HTTP establishes connections. Normally it uses
( run in 0.457 second using v1.01-cache-2.11-cpan-2398b32b56e )