IO-Socket-Socks-Wrapper
view release on metacpan or search on metacpan
t/01_in_pkg.t view on Meta::CPAN
use Test::More;
BEGIN { use_ok('IO::Socket::Socks::Wrapper') };
require 't/subs.pm';
use IO::Socket::Socks;
use strict;
warn '$IO::Socket::Socks::SOCKET_CLASS = ', $IO::Socket::Socks::SOCKET_CLASS, "\n";
$^W = 0;
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
SKIP: {
skip "fork, windows, sux" if $^O =~ /MSWin/i;
eval { require LWP::UserAgent; require LWP::Protocol::http; }
or skip "No LWP found";
my ($s_pid, $s_host, $s_port) = make_socks_server(4);
my ($h_pid, $h_host, $h_port) = make_http_server();
t/02_in_pkg_no_global.t view on Meta::CPAN
#!/usr/bin/env perl
use Test::More;
use IO::Socket::Socks::Wrapper;
require 't/subs.pm';
use strict;
$^W = 0;
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
SKIP: {
skip "fork, windows, sux" if $^O =~ /MSWin/i;
eval { require Net::HTTP; require Net::FTP }
or skip "No Net::HTTP or Net::FTP";
my ($s_pid, $s_host, $s_port) = make_socks_server(4);
my ($h_pid, $h_host, $h_port) = make_http_server();
t/03_global.t view on Meta::CPAN
use IO::Socket::Socks::Wrapper {
ProxyAddr => $s_host,
ProxyPort => $s_port
};
use Socket;
use Test::More;
require 't/subs.pm';
$^W = 0;
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
SKIP: {
skip "fork, windows, sux" if $^O =~ /MSWin/i;
eval { require LWP; require Net::HTTP; require Net::FTP }
or skip "No LWP or Net::FTP found";
if (%IO::Socket::IP:: && $IO::Socket::IP::VERSION >= 0.08 && $IO::Socket::IP::VERSION < 0.35) {
skip "IO::Socket::IP with non overridable CORE::connect detected";
#!/usr/bin/env perl
use Test::More;
use IO::Socket::Socks::Wrapper;
require 't/subs.pm';
use strict;
$^W = 0;
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
SKIP: {
skip "fork, windows, sux" if $^O =~ /MSWin/i;
eval { require HTTP::Tiny }
or skip "No HTTP::Tiny found";
my ($s_pid, $s_host, $s_port) = make_socks_server(5);
my ($h_pid, $h_host, $h_port) = make_http_server();
#!/usr/bin/env perl
use Test::More;
use IO::Socket::Socks::Wrapper;
require 't/subs.pm';
use strict;
$^W = 0;
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
SKIP: {
skip "no fork support" if $^O =~ /MSWin/i;
eval { require LWP; }
or skip 'No LWP installed';
my ($s_pid4, $s_host4, $s_port4) = make_socks_server(4);
my ($s_pid5, $s_host5, $s_port5) = make_socks_server(5);
our ($hs_pid, $hs_host, $hs_port) = make_socks_server(4);
our ($cs_pid, $cs_host, $cs_port) = make_socks_server(5);
our ($h_pid, $h_host, $h_port) = make_http_server();
our ($f_pid, $f_host, $f_port) = make_ftp_server();
}
else {
plan skip_all => "Net::FTP or HTTP::Tiny was not found";
}
}
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
}
use HTTP::Tiny;
use lib 't';
use IO::Socket::Socks::Wrapper (
'Net::FTP' => {
ProxyAddr => our $fs_host,
ProxyPort => our $fs_port,
t/08_timeout.t view on Meta::CPAN
}
else {
plan skip_all => "SOCKS_WRAPPER_SLOW_TESTS environment variable should has true value to run this tests";
}
}
else {
plan skip_all => "No windows support for this test";
}
$ENV{PERL_HTTP_TINY_IPV4_ONLY} = 1;
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
}
use IO::Socket::Socks::Wrapper (
Connect => {
_norequire => 1,
ProxyAddr => $s_host,
ProxyPort => $s_port,
SocksVersion => 4,
Timeout => 2
t/10_event_loop_anyevent.t view on Meta::CPAN
undef $w;
},
destroy_io_watcher => sub {
$destroyed = 1;
}
}
}
};
require 't/subs.pm';
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
eval {
require AnyEvent;
require AnyEvent::HTTP;
AnyEvent::HTTP->import();
};
if ($@) {
kill 15, $s_pid;
t/10_event_loop_mojo.t view on Meta::CPAN
destroy_io_watcher => sub {
my $hdl = shift;
$reactor->remove($hdl);
$destroyed = 1;
}
}
}
};
require 't/subs.pm';
$ENV{http_proxy} = $ENV{HTTP_PROXY} =
$ENV{https_proxy} = $ENV{HTTPS_PROXY} =
$ENV{all_proxy} = $ENV{ALL_PROXY} = undef;
eval {
require Mojolicious;
Mojolicious->VERSION(4.85); # next_tick
require Mojo::IOLoop;
require Mojo::UserAgent;
};
if ($@) {
( run in 2.367 seconds using v1.01-cache-2.11-cpan-71847e10f99 )