POE::Component::Client::SOCKS provides SOCKSification services to other POE sessions and components. It accepts connection requests and deals with all the SOCKS negotiation on your behalf. It returns either a SuccessEvent which will have a shiny socket handle for you to use or an FailureEvent which should say what went wrong.

One may start POE::Component::Client::SOCKS in two ways. If you spawn it creates a session that can then broker lots of SOCKS connections on your behalf. Or you may use 'connect' and 'bind' to broker one connection instance.

Creates a one-shot POE::Component::Client::SOCKS session that will connect to a SOCKS server and negotiate a CONNECT. Takes the following parameters ( mandatory ones are indicated ):

'SocksProxy', the SOCKS server that you want to connect to (Mandatory);
'RemoteAddress', the address that you want the SOCKS proxy to connect to (Mandatory);
'RemotePort', the port that you want the SOCKS proxy to connect to (Mandatory);
'SuccessEvent', the event that will be sent when a CONNECT is successful (Mandatory);
'FailureEvent', the event to send when a CONNECT is not successful or errored (Mandatory);
'SocksPort', the SOCKS server port to connect to (default is 1080);

Takes any number of arbitary parameters that will passed through to the SuccessEvent/FailureEvent. Please use underscore prefixes to avoid future API changes.

Creates a one-shot POE::Component::Client::SOCKS session that will connect to a SOCKS server and negotiate a BIND. Takes the following parameters ( mandatory ones are indicated ):

'SocksProxy', the SOCKS server that you want to connect to (Mandatory);
'RemoteAddress', the address that you want the SOCKS proxy to connect to (Mandatory);
'RemotePort', the port that you want the SOCKS proxy to connect to (Mandatory);
'SuccessEvent', the event that will be sent when a BIND is successful (Mandatory);
'FailureEvent', the event to send when a BIND is not successful or errored (Mandatory);
'SocksPort', the SOCKS server port to connect to (default is 1080);

Takes any number of arbitary parameters that will passed through to the SuccessEvent/FailureEvent. Please use underscore prefixes to avoid future API changes.

Connect to a SOCKS server and negotiate a CONNECT. Takes the following parameters ( mandatory ones are indicated ):

'SocksProxy', the SOCKS server that you want to connect to (Mandatory);
'RemoteAddress', the address that you want the SOCKS proxy to connect to (Mandatory);
'RemotePort', the port that you want the SOCKS proxy to connect to (Mandatory);
'SuccessEvent', the event that will be sent when a CONNECT is successful (Mandatory);
'FailureEvent', the event to send when a CONNECT is not successful or errored (Mandatory);
'SocksPort', the SOCKS server port to connect to (default is 1080);

Takes any number of arbitary parameters that will passed through to the SuccessEvent/FailureEvent. Please use underscore prefixes to avoid future API changes.

Connect to a SOCKS server and negotiate a BIND. Takes the following parameters ( mandatory ones are indicated ):

'SocksProxy', the SOCKS server that you want to connect to (Mandatory);
'RemoteAddress', the address that you want the SOCKS proxy to connect to (Mandatory);
'RemotePort', the port that you want the SOCKS proxy to connect to (Mandatory);
'SuccessEvent', the event that will be sent when a BIND is successful (Mandatory);
'FailureEvent', the event to send when a BIND is not successful or errored (Mandatory);
'SocksPort', the SOCKS server port to connect to (default is 1080);

Takes any number of arbitary parameters that will passed through to the SuccessEvent/FailureEvent. Please use underscore prefixes to avoid future API changes.

Connect to a SOCKS server and negotiate a CONNECT. Takes the following parameters ( mandatory ones are indicated ):

'SocksProxy', the SOCKS server that you want to connect to (Mandatory);
'RemoteAddress', the address that you want the SOCKS proxy to connect to (Mandatory);
'RemotePort', the port that you want the SOCKS proxy to connect to (Mandatory);
'SuccessEvent', the event that will be sent when a CONNECT is successful (Mandatory);
'FailureEvent', the event to send when a CONNECT is not successful or errored (Mandatory);
'SocksPort', the SOCKS server port to connect to (default is 1080);

Takes any number of arbitary parameters that will passed through to the SuccessEvent/FailureEvent. Please use underscore prefixes to avoid future API changes.

Connect to a SOCKS server and negotiate a BIND. Takes the following parameters ( mandatory ones are indicated ):

'SocksProxy', the SOCKS server that you want to connect to (Mandatory);
'RemoteAddress', the address that you want the SOCKS proxy to connect to (Mandatory);
'RemotePort', the port that you want the SOCKS proxy to connect to (Mandatory);
'SuccessEvent', the event that will be sent when a BIND is successful (Mandatory);
'FailureEvent', the event to send when a BIND is not successful or errored (Mandatory);
'SocksPort', the SOCKS server port to connect to (default is 1080);

Takes any number of arbitary parameters that will passed through to the SuccessEvent/FailureEvent. Please use underscore prefixes to avoid future API changes.

Generated if something went wrong, either a connection could not be established with the SOCKS server or the SOCKS server rejected our request.

If a connection to the SOCKS server could not be established then the following will exist:

'sockerr', an arrayref containing the operation, errnum and errstr as returned by
POE::Wheel::SocketFactory;

If the SOCKS server rejected our request for some reason the following will exist:

'socks_unknown', a string error message. This is generated if we get a garbled response
from the SOCKS server;
'socks_error', an integer response from the SOCKS server, indicating that it has rejected the
request.