-
-
26 Nov 2021 14:52:18 UTC
- Distribution: UniEvent-Socks
- Module version: 1.0.1
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (64 / 0 / 0)
- Kwalitee
Bus factor: 1- License: unknown
- Activity
24 month- Tools
- Download (14.58KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Export::XS
- Net::SockAddr
- URI::XS
- UniEvent
- XS::Framework
- XS::Install
- XS::libcares
- XS::libpanda
- XS::libuv
- next::XS
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
UniEvent::Socks - Socks support for UniEvent's tcp handles.
DESCRIPTION
UniEvent::Socks makes it possible to connect UniEvent's tcp handle via socks proxy server.
UniEvent::Socks is a stream filter, it doesn't change API of tcp handle. Just use it as you would without socks proxy.
SYNOPSIS
use UniEvent::Socks; my $tcp = UniEvent::Tcp->new; UniEvent::Socks::use_socks($tcp, $proxy_host, $proxy_port); $tcp->connect($host, $port); # connect to destination via proxy $tcp->connect_callback(sub { # called when connect to destination via proxy is established }); ... # use as arbitrary connection # via object method $tcp->use_socks("socks5://myproxy.com:1111");
FUNCTIONS
use_socks($tcp_handle, $proxy_host, $proxy_port, [$login], [$password], [$socks_resolve])
Enables socks proxy for tcp handle.
$proxy_host
and$proxy_port
is the location of socks 5 proxy. Optional login and password can be defined to authorize on socks proxy.If
$socks_resolve
is true andhost
supplied to tcp handle'sconnect()
method is a domain name, then name resolution will be made on socks proxy server's side.use_socks($tcp_handle, $uri)
Gets
host
,port
,login
andpassword
from an URI and calls the above version ofuse_socks()
with these params andsocks_resolve
= true.URI must be a string or an object of class URI::XS. It must have "socks5" scheme ("sock5://user:pass@host:port/").
METHODS
For convenience,
UniEvent::Socks
addsuse_socks()
method toUniEvent::Tcp
package. Its synopsis is the same as for functions described above except for the first argument$tcp_handle
which should not be passed.AUTHOR
Pronin Oleg <syber@cpan.org>, Crazy Panda LTD
LICENSE
You may distribute this code under the same terms as Perl itself.
Module Install Instructions
To install UniEvent::Socks, copy and paste the appropriate command in to your terminal.
cpanm UniEvent::Socks
perl -MCPAN -e shell install UniEvent::Socks
For more information on module installation, please visit the detailed CPAN module installation guide.