Created
December 6, 2011 15:21
-
-
Save olegwtf/1438551 to your computer and use it in GitHub Desktop.
I:S:S:W runtime proxy changing test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
$ENV{SOCKS_DEBUG} = 1; | |
} | |
use IO::Socket::Socks::Wrapper ( | |
Net::FTP => { | |
ProxyAddr => 'localhost', | |
ProxyPort => 1080, | |
SocksVersion => 5 | |
}, | |
Net::FTP::dataconn => { | |
ProxyAddr => 'localhost', | |
ProxyPort => 1080, | |
SocksVersion => 5 | |
} | |
); | |
use Net::FTP::AutoReconnect; | |
use Data::Dumper; | |
use strict; | |
my $ftp = Net::FTP::AutoReconnect->new('gorodok.net', Passive => 1) | |
or die $@; | |
$ftp->login('yyy', 'xxx') | |
or die $ftp->message; | |
my @list = $ftp->ls() | |
or die $ftp->message; | |
print Dumper \@list; | |
$ftp->quit(); | |
IO::Socket::Socks::Wrapper->import( | |
Net::FTP:: => { | |
ProxyAddr => '87.117.198.197', | |
ProxyPort => 1080, | |
SocksVersion => 4 | |
}, | |
Net::FTP::dataconn:: => { | |
ProxyAddr => '87.117.198.197', | |
ProxyPort => 1080, | |
SocksVersion => 4 | |
} | |
); | |
$ftp = Net::FTP::AutoReconnect->new('gorodok.net', Passive => 1) | |
or die $@; | |
$ftp->login('yyy', 'xxx') | |
or die $ftp->message; | |
@list = $ftp->ls() | |
or die $ftp->message; | |
print Dumper \@list; | |
$ftp->quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment