NAME
Net::SOCKS - a SOCKS client class
SYNOPSIS
Establishing a connection:my $sock = new Net::SOCKS(socks_addr => '192.168.1.3',socks_port => 1080,user_id => 'the_user',user_password => 'the_password',force_nonanonymous => 1,protocol_version => 5);# connect to finger port and request finger information for some_usermy $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79);print $f "some_user\n"; # example writing to socketwhile (<$f>) { print } # example reading from socket$sock->close();Accepting an incoming connection:my $sock = new Net::SOCKS(socks_addr => '192.168.1.3',socks_port => 1080,user_id => 'the_user',user_password => 'the_password',force_nonanonymous => 1,protocol_version => 5);my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "128.10.10.11",peer_port => 9999);$f= $sock->accept();print $f "Hi! Type something.\n"; # example writing to socketwhile (<$f>) { print } # example reading from socket$sock->close();
DESCRIPTION
my $sock = new Net::SOCKS(socks_addr => '192.168.1.3',socks_port => 1080,user_id => 'the_user',user_password => 'the_password',force_nonanonymous => 1,protocol_version => 5);To connect to a SOCKS server, specify the SOCKS server'shostname, port number, SOCKS protocol version, username, andpassword. Username and password are optional if you planto use a SOCKS server that doesn't require any authentication.If you would like to force the connection to benonanoymous, set the force_nonanonymous parameter.my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79);To connect to another machine using SOCKS, use the connect method.Specify the host and port number as parameters.my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "192.168.1.3",peer_port => 9999);If you wanted to accept a connection with SOCKS, specify the hostand port of the machine you expect a connection from. Uponsuccess, bind() returns the ip address and port number thatthe SOCKS server is listening at on your behalf.$f= $sock->accept();If a call to bind() returns a success status code SOCKS_OKAY,a call to the accept() method will return when the peer hostconnects to the host/port that was returned by the bind() method.Upon success, accept() returns SOCKS_OKAY.$sock->close();Closes the connection.
SEE ALSO
RFC 1928, RFC 1929.
AUTHOR
Clinton Wong, [email protected]
COPYRIGHT
Copyright (c) 1997-1998 Clinton Wong. All rights reserved.This program is free software; you can redistribute itand/or modify it under the same terms as Perl itself.