Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::socks(3pm) [debian man page]

Net::SOCKS(3pm) 					User Contributed Perl Documentation					   Net::SOCKS(3pm)

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_user my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79); print $f "some_user "; # example writing to socket while (<$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. "; # example writing to socket while (<$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's hostname, port number, SOCKS protocol version, username, and password. Username and password are optional if you plan to use a SOCKS server that doesn't 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 => '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 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. SEE ALSO
RFC 1928, RFC 1929. AUTHOR
Clinton Wong, clintdw@netcom.com COPYRIGHT
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. perl v5.14.2 2012-04-18 Net::SOCKS(3pm)

Check Out this Related Man Page

CONNECT-PROXY(1)					      General Commands Manual						  CONNECT-PROXY(1)

NAME
connect-proxy -- connect over SOCKS4/5 proxy SYNOPSIS
connect-proxy [-dnhst45] [-R resolve ] [-p local-port ] [-w secs ] [-H [user@]proxy-server[:port]] ] [-S [user@]socks-server[:port]] ] [-T proxy-server[:port] ] [-c telnet-proxy-command ] [host] [port] DESCRIPTION
connect-proxy open connection over SOCKS4/5 proxies Please, note that any HTTP-Proxy tunnel won't work with content-inspection firewall (unless using SSL). OPTIONS
-H specifies a hostname and port number of the http proxy server to relay. If port is omitted, 80 is used. You can specify this value in the environment variable HTTP_PROXY and pass the -h option to use it. -S specifies the hostname and port number of the SOCKS server to relay. Like -H, port number can be omitted and the default is 1080. You can also specify this value pair in the environment variable SOCKS5_SERVER and give the -s option to use it. -4 specifies SOCKS relaying and indicates protocol version to use. It is valid only when used with '-s' or '-S'. Default is '-5' (protocol version 5) -R method to resolve the hostname. Three keywords ("local", "remote", "both") or dot-notation IP address are acceptable. The key- word "both" means, "Try local first, then remote". If a dot-notation IP address is specified, use this host as nameserver. The default is "remote" for SOCKS5 or "local" for others. On SOCKS4 protocol, remote resolving method ("remote" and "both") requires protocol 4a supported server. -p will forward a local TCP port instead of using the standard input and output. -P same to '-p' except keep remote session. The program repeats waiting the port with holding remote session without disconnecting. To connect the remote session, send EOF to stdin or kill the program. -w timeout in seconds for making connection with TARGET host. -d used for debug. If you fail to connect, use this and check request to and response from server. USAGE
To use proxy, this example is for SOCKS5 connection to connect to "host" at port 25 via SOCKS5 server on "firewall" host. connect-proxy -S firewall host 25 SOCKS5_SERVER=firewall; export SOCKS5_SERVER; connect-proxy -s host 25 For a HTTP-PROXY connection: connect-proxy -H proxy-server:8080 host 25 HTTP_PROXY=proxy-server:8080; export HTTP_PROXY; connect-proxy -h host 25 To forward a local port, for example to use ssh: connect-proxy -p 5550 -H proxy-server:8080 host 22 ssh -l user To use it along ssh transparently: # file://~/.ssh/config # not using proxy on lan Host 192.* ProxyCommand connect-proxy %h %p # mandatory to access the internet Host * ProxyCommand connect-proxy -H proxyserver:8080 %h %p Or for all users ( /etc/ssh/ssh_config ) ENVIRONMENT
SOCKS5_USER, SOCKS5_PASSWORD, HTTP_PROXY_USER, HTTP_PROXY_PASSWORD, CONNECT_PASSWORD, LOGNAME, USER SEE ALSO
ssh (1). WWW
http://www.meadowy.org/~gotoh/projects/connect AUTHOR
This manual page was written by Philippe Coval rzr@gna.org for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. CONNECT-PROXY(1)
Man Page