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

NE_SESSION_PROXY(3)						neon API reference					       NE_SESSION_PROXY(3)

NAME
ne_session_proxy, ne_session_socks_proxy, ne_session_system_proxy, ne_set_addrlist - configure proxy servers SYNOPSIS
#include <ne_session.h> void ne_session_proxy(ne_session *session, const char *hostname, unsigned int port); void ne_session_system_proxy(ne_session *session, unsigned int flags); void ne_session_socks_proxy(ne_session *session, enum ne_sock_sversion version, const char *hostname, unsigned int port, const char *username, const char *password); void ne_set_addrlist(ne_session *session, const ne_inet_addr **addrlist, size_t count); DESCRIPTION
One (and no more than one) of the functions ne_session_proxy, ne_session_system_proxy, ne_session_socks_proxy, ne_set_addrlist can be used to configure a proxy server for a given session object. If more than one function is invoked for any given session object, only the last call has effect. If one of the functions is to be used, it must be used before the creation of any request object for the session. HTTP proxy specification The ne_session_proxy function configures use of an HTTP proxy server for the session, the location of which is given by the hostname and port paramters. If the proxy requires authentication, ne_set_proxy_auth should be used. System proxy configuration The ne_session_system_proxy function configures the session to use any proxy servers specified by the system configuration. Support for this function is platform-specific; if unsupported, the function has no effect. SOCKS proxy configuration The ne_session_socks_proxy function configures the session to use a SOCKS proxy. The version indicates which version of the SOCKS protocol should be used. The hostname and port parameters specify the SOCKS proxy location. Note that a server with only an IPv6 address cannot be used with SOCKS v4 or v4A. The interpretation of the other arguments depends on the version specified: NE_SOCK_SOCKSV4 (version 4) The username parameter must be non-NULL; the password parameter is ignored. NE_SOCK_SOCKSV4A (version 4A) The username parameter must be non-NULL; the password parameter is ignored. NE_SOCK_SOCKSV5 (version 5) The username parameter may be NULL; if it is non-NULL, the password parameter must also be non-NULL; otherwise, it is ignored.. Origin server address override The ne_set_addrlist function forces use of an address and port the a specified list when establishing a TCP connection, ignoring the "real" hostname and port identifying the origin server for the session (as passed to ne_session_create). The origin server's "real" hostname and port will still be used in the Host header in HTTP requests. When a connection is required, the library will iterate through the addrlist list, attempting to connect to the address addrlist[0] through to addrlist[count-1] in turn, until a connection can be established. RETURN VALUES
None of the functions described here has a return value. EXAMPLES
Create and destroy a session: ne_session *sess; sess = ne_session_create("http", "host.example.com", 80); ne_session_proxy(sess, "proxy.example.com", 3128); /* ... use sess ... */ ne_session_destroy(sess); SEE ALSO
ne_ssl_set_verify, ne_ssl_trust_cert, ne_sock_init, ne_set_session_flag AUTHOR
Joe Orton <neon@lists.manyfish.co.uk> Author. COPYRIGHT
neon 0.30.0 31 July 2013 NE_SESSION_PROXY(3)
Man Page