Apache-HTTunnel
view release on metacpan or search on metacpan
Client/lib/HTTunnel/Client.pm view on Meta::CPAN
package HTTunnel::Client ;
@ISA = qw(LWP::UserAgent) ;
use strict ;
use LWP::UserAgent ;
use HTTP::Request::Common ;
use HTTP::Status ;
use IO::Select ;
use Carp ;
$HTTunnel::Client::VERSION = '0.08' ;
sub new {
my $class = shift ;
Client/lib/HTTunnel/Client.pm view on Meta::CPAN
my $data = shift ;
if ($this->{__PACKAGE__}->{pid} != $$){
# Reset the connection cache since we probably have forked.
if ($this->conn_cache()){
$this->conn_cache({total_capacity => 1}) ;
}
$this->{__PACKAGE__}->{pid} = $$ ;
}
my $req = HTTP::Request::Common::POST(
join("/", $this->{__PACKAGE__}->{url}, $cmd, @{$args}),
{"Content-Length" => length($data || '')},
"content" => $data
) ;
$req->protocol("HTTP/1.1") ;
$this->request_callback($req) ;
my $resp = $this->request($req) ;
$this->response_callback($resp) ;
if ($resp->code() != RC_OK()){
Client/lib/HTTunnel/Client.pod view on Meta::CPAN
=item get_peer_info ( )
The C<get_peer_info> method returns information about the remote connection.
A string containing the IP address and port number, separated by a colon (:)
is returned. This method can be useful with UDP connections to validate the
sender of each packet.
=item request_callback ( REQUEST )
The C<request_callback> method is a callback method that can be used to
access the C<HTTP::Request> object just before it is sent. The default
implementation does nothing.
=item response_callback ( RESPONSE )
The C<response_callback> method is a callback method that can be used to
access the C<HTTP::Response> object just after it is received. The default
implementation does nothing.
=back
( run in 0.358 second using v1.01-cache-2.11-cpan-de7293f3b23 )