Posted on 2009-10-21 10:09:08-07 by alex1983
Please help with socks
Hello guys, So I'm trying to connect to remote host via SOCKS5 proxy using IO::Socket:Socks module. How I can check the proxy is dead or remote host is dead when I get undef after constructor calling? The same about Net::SOCKS module. Thanks guys!!!
use IO::Socket::Socks; my $sock = new IO::Socket::Socks(ProxyAddr=>"XXX.XXX.XXX.XXX", ProxyPort=>"PXXX", ConnectAddr=>"YYY.YYY.YYY.YYY", ConnectPort=>PYYY, AuthType=>"none", SocksDebug=>1 ); if(!defined $sock) { # How I can check who is dead XXX.XXX.XXX.XXX:PXXX or YYY.YYY.YYY.YYY:PYYY? # }
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.