NAME

Net::SOCKS - a SOCKS client class

SYNOPSIS

Establishing a connection:

my $sock = new Net::SOCKS(socks_addr => '128.10.10.11', socks_port => 1080, user_id => 'clintdw', protocol_version => 4);

my $f= $sock->connect(peer_addr => '128.10.10.11', peer_port => 79); print $f "clintdw\n"; # example writing to socket while (<$f>) { print } # example reading from socket $sock->close();

Accepting an incoming connection:

$sock = new Net::SOCKS(socks_addr => '128.10.10.11', socks_port => 1080, user_id => 'clintdw', protocol_version => 4);

my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "128.10.10.11", peer_port => 9999);

$f= $sock->accept(); print $f "clintdw\n"; # example writing to socket while (<$f>) { print } # example reading from socket $sock->close();

DESCRIPTION

$sock = new Net::SOCKS(socks_addr => '128.10.10.11', socks_port => 1080, user_id => 'clintdw', protocol_version => 4);

To connect to a SOCKS server, specify the SOCKS server's
hostname, port number, SOCKS protocol version, and optional
username (for auth purposes).

my $f= $sock->connect(peer_addr => '128.10.10.11', 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 => "128.10.10.11", peer_port => 9999);

If you wanted to accept a connection with SOCKS, specify the host
and port of the machine you expect a connection from.  Upon
success, bind() returns the ip address and port number that
the SOCKS server is listening at on your behalf.

$f= $sock->accept();

If a call to bind() returns a success status code STATUS_OKAY,
a call to the accept() method will return when the peer host
connects to the host/port that was returned by the bind() method.
Upon success, accept() returns STATUS_OKAY.

$sock->close();

Closes the connection.

AUTHOR

Clinton Wong, clintdw@netcom.com

Copyright (c) 1997 Clinton Wong. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl(1).