.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::SOCKS 3pm" .TH Net::SOCKS 3pm "2022-11-19" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::SOCKS \- a SOCKS client class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& Establishing a connection: \& \& my $sock = new Net::SOCKS(socks_addr => \*(Aq192.168.1.3\*(Aq, \& socks_port => 1080, \& user_id => \*(Aqthe_user\*(Aq, \& user_password => \*(Aqthe_password\*(Aq, \& force_nonanonymous => 1, \& protocol_version => 5); \& \& # connect to finger port and request finger information for some_user \& my $f= $sock\->connect(peer_addr => \*(Aq192.168.1.3\*(Aq, peer_port => 79); \& print $f "some_user\en"; # example writing to socket \& while (<$f>) { print } # example reading from socket \& $sock\->close(); \& \& Accepting an incoming connection: \& \& my $sock = new Net::SOCKS(socks_addr => \*(Aq192.168.1.3\*(Aq, \& socks_port => 1080, \& user_id => \*(Aqthe_user\*(Aq, \& user_password => \*(Aqthe_password\*(Aq, \& 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.\en"; # example writing to socket \& while (<$f>) { print } # example reading from socket \& $sock\->close(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 6 \& my $sock = new Net::SOCKS(socks_addr => \*(Aq192.168.1.3\*(Aq, \& socks_port => 1080, \& user_id => \*(Aqthe_user\*(Aq, \& user_password => \*(Aqthe_password\*(Aq, \& force_nonanonymous => 1, \& protocol_version => 5); \& \& To connect to a SOCKS server, specify the SOCKS server\*(Aqs \& hostname, port number, SOCKS protocol version, username, and \& password. Username and password are optional if you plan \& to use a SOCKS server that doesn\*(Aqt require any authentication. \& If you would like to force the connection to be \& nonanoymous, set the force_nonanonymous parameter. \& \& my $f= $sock\->connect(peer_addr => \*(Aq192.168.1.3\*(Aq, 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 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 SOCKS_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 SOCKS_OKAY. \& \& $sock\->close(); \& \& Closes the connection. .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& RFC 1928, RFC 1929. .Ve .SH "AUTHOR" .IX Header "AUTHOR" .Vb 1 \& Clinton Wong, clintdw@netcom.com .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 3 \& Copyright (c) 1997\-1998 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. .Ve