LWP-Protocol-https-SocksChain10

 view release on metacpan or  search on metacpan

Changelog  view on Meta::CPAN

1.7
	cleanup LWP::Debug ( Bug fixed: 51786 )

1.6
	Cleanup for LWP::Debug::trace

1.5
	Added client certificate support ( thanks Andrew Deryabin )

1.4
	Support IO::Socket::SSL > 0.97

1.3
	Fix deprecursion bug

1.2
	Fix global redefinition $^W


META.yml  view on Meta::CPAN

--- #YAML:1.0
name:                LWP-Protocol-https-SocksChain10
version:             1.7
abstract:            ~
license:             ~
author:              
    - Igor Okunev <igor@prv.mts-nn.ru>
generated_by:        ExtUtils::MakeMaker version 6.42
distribution_type:   module
requires:     
    IO::Socket::SSL:               
    LWP:                           
    Net::SC:                       1.11
meta-spec:
    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
    version: 1.3

Makefile.PL  view on Meta::CPAN


use ExtUtils::MakeMaker;
WriteMakefile(
    NAME              => 'LWP::Protocol::https::SocksChain10',
    VERSION_FROM      => 'SocksChain10.pm',
    PREREQ_PM         => {	Net::SC => 1.11,
							IO::Socket::SSL => undef,
							LWP => undef
						},
	'AUTHOR'		=> 'Igor Okunev <igor@prv.mts-nn.ru>',
);

README  view on Meta::CPAN

       make install

DEPENDENCIES

    This module requires these other modules and libraries:

       LWP

       Net::SC

       IO::Socket::SSL

SocksChain10.pm  view on Meta::CPAN

package LWP::Protocol::https::SocksChain10;

use strict;
use vars qw( @ISA $VERSION @EXTRA_SOCK_OPTS );

use Net::SC;

use HTTP::Response;
use HTTP::Status;
use IO::Select;
use IO::Socket::SSL;
use LWP::Protocol;

($VERSION='$Revision: 1.7 $')=~s/^\S+\s+(\S+)\s+.*/$1/;

local $^W = 1;

@ISA = qw(
				LWP::Protocol
				IO::Socket::SSL
		);

sub IO::Socket::SSL::SSL_HANDLE::READ { ${shift()}->read     (@_) }

my $CRLF = "\015\012";

sub _new_socket
{
	my($self, $host, $port, $timeout ) = @_;

	my %cfg = (
				PeerHost	=> $host,
				PeerPort	=> $port,

SocksChain10.pm  view on Meta::CPAN

	}

	my $sc = Net::SC->new( %cfg ) || die $!;

	unless ( ( my $rc = $sc->connect( $host, $port ) ) == SOCKS_OKAY ) {
		die socks_error($rc) . "\n";
	}

	my $obj = bless $sc->sh;

	if ( $IO::Socket::SSL::VERSION > 0.97 ) {
		$obj->configure_SSL( \%cfg ) && $obj->connect_SSL();
	} else {
		$obj->configure_SSL( \%cfg ) && $obj->connect_SSL($sc->sh);
	}

	unless ($obj) {
# IO::Socket leaves additional error messages in $@
		$@ =~ s/^.*?: //;
		die "Can't connect to $host:$port ($@)";
	}



( run in 0.435 second using v1.01-cache-2.11-cpan-4d50c553e7e )