NIOSOCKS
SOCKS v5 protocol implementation
import NIOSOCKS
Module information
- Declarations
- 102
- Symbols
- 159
Overview
An implementation of SOCKS v5 protocol. See RFC1928.
Add the appropriate channel handler to the start of your channel pipeline to use this protocol.
For an example see the NIOSOCKSClient target.
Channel Handlers
class SOCKSClientHandler
Connects to a SOCKS server to establish a proxied connection to a host. This handler should be inserted at the beginning of a channel’s pipeline. Note that SOCKS only supports fully-qualified domain names and IPv4 or IPv6 sockets, and not UNIX sockets.
class SOCKSServerHandshakeHandler
Add this handshake handler to the front of your channel, closest to the network. The handler will receive bytes from the network and run them through a state machine and parser to enforce SOCKSv5 protocol correctness. Inbound bytes will by parsed into
ClientMessage
for downstream consumption. SendServerMessage
to this handler.
Client Messages
enum ClientMessage
Sent by the client and received by the server.
struct ClientGreeting
Clients begin the SOCKS handshake process by providing an array of suggested authentication methods.
struct SOCKSRequest
Instructs the SOCKS proxy server of the target host, and how to connect.
Server Messages
enum ServerMessage
Sent by the server and received by the client.
struct SelectedAuthenticationMethod
Used by the SOCKS server to inform the client which authentication method it would like to use out of those offered.
struct SOCKSResponse
The SOCKS Server’s response to the client’s request indicating if the request succeeded or failed.
Supporting Types
struct AuthenticationMethod
The SOCKS authentication method to use, defined in RFC 1928.
struct SOCKSServerReply
Used to indicate if the SOCKS client’s connection request succeeded or failed.
struct SOCKSCommand
What type of connection the SOCKS server should establish with the target host.
enum SOCKSAddress
The address used to connect to the target host.
struct SOCKSProxyEstablishedEvent
A
Channel
user event that is sent when a SOCKS connection has been establishedenum SOCKSError
Wrapper for SOCKS protcol error.