Client-side proxy configuration for SOCKS5, defined by RFC 1928.
Multiple authentication methods are supported via
putAuthenticationFactory(Socks5..
By default only the NO AUTH
authentication method is configured.
The USERNAME/PASSWORD
is available to applications but must be explicitly configured and
added.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ClientConnectionFactory | newClientConnectionFactory(ClientConnectionFactory
the nested connectionFactory)ClientConnectionFactoryImplements abstract org. |
| public Socks5. | Returns: the previous authentication method of the same type, ornull
if there was none of that type already presentthe SOCKS5 authentication factory authenticationFactoryProvides this class with the given SOCKS5 authentication method. |
| public Socks5. | removeAuthenticationFactory(byte
the authentication method to remove method)Removes the authentication of the given |
| authentications | back to summary |
|---|---|
| private final Map<Byte, Socks5. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| Socks5Proxy | back to summary |
|---|---|
| public Socks5Proxy(String host, int port) | |
| Socks5Proxy | back to summary |
|---|---|
| public Socks5Proxy(Origin. | |
| newClientConnectionFactory | back to summary |
|---|---|
| public ClientConnectionFactory newClientConnectionFactory(ClientConnectionFactory connectionFactory) Implements abstract org.
| |
| putAuthenticationFactory | back to summary |
|---|---|
| public Socks5. Provides this class with the given SOCKS5 authentication method.
| |
| removeAuthenticationFactory | back to summary |
|---|---|
| public Socks5. Removes the authentication of the given
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ClientConnectionFactory |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Connection | newConnection(EndPoint
the endPoint, Map<String, Object> org. to link the newly created connection tothe context data to create the connection context)Implements org. |
| connectionFactory | back to summary |
|---|---|
| private final ClientConnectionFactory connectionFactory | |
| Socks5ProxyClientConnectionFactory | back to summary |
|---|---|
| private Socks5ProxyClientConnectionFactory(ClientConnectionFactory connectionFactory) | |
| newConnection | back to summary |
|---|---|
| public Connection newConnection(EndPoint endPoint, Map<String, Object> context) Implements org.
| |
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final ByteBuffer | |
| private final ClientConnectionFactory | |
| private final Map | |
| private static final Pattern | |
| private Socks5Proxy. |
| Access | Constructor and Description |
|---|---|
| private | Socks5ProxyConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map<String, Object> context, Map<Byte, Socks5.
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| public void | onFillable()
Implements abstract org. Callback method invoked when the endpoint is ready to be read. |
| public boolean | onIdleExpired(TimeoutException timeout)
Overrides org. Implements org. Callback method invoked upon an idle timeout event. |
| public void | onOpen()
Overrides org. Implements org. Callback method invoked when this connection is opened. |
| public ByteBuffer | onUpgradeFrom()
Implements org. Invoked during an |
| private void | |
| private void | |
| private void | |
| private void | |
| private void |
| authentications | back to summary |
|---|---|
| private final Map<Byte, Socks5. | |
| byteBuffer | back to summary |
|---|---|
| private final ByteBuffer byteBuffer | |
| connectionFactory | back to summary |
|---|---|
| private final ClientConnectionFactory connectionFactory | |
| context | back to summary |
|---|---|
| private final Map<String, Object> context | |
| IPv4_PATTERN | back to summary |
|---|---|
| private static final Pattern IPv4_PATTERN | |
| state | back to summary |
|---|---|
| private Socks5Proxy. | |
| Socks5ProxyConnection | back to summary |
|---|---|
| private Socks5ProxyConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map<String, Object> context, Map<Byte, Socks5. | |
| connectSent | back to summary |
|---|---|
| private void connectSent() | |
| fail | back to summary |
|---|---|
| private void fail(Throwable x) | |
| handshakeSent | back to summary |
|---|---|
| private void handshakeSent() | |
| onFillable | back to summary |
|---|---|
| public void onFillable() Implements abstract org. Doc from org. Callback method invoked when the endpoint is ready to be read.
| |
| onIdleExpired | back to summary |
|---|---|
| public boolean onIdleExpired(TimeoutException timeout) Overrides org. Implements org. Doc from org. Callback method invoked upon an idle timeout event. Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed. When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
| |
| onOpen | back to summary |
|---|---|
| public void onOpen() Overrides org. Implements org. Doc from org. Callback method invoked when this connection is opened. Creators of the connection implementation are responsible for calling this method.
| |
| onUpgradeFrom | back to summary |
|---|---|
| public ByteBuffer onUpgradeFrom() Implements org. Doc from org. Invoked during an
| |
| receiveConnect | back to summary |
|---|---|
| private void receiveConnect() throws IOException | |
| receiveHandshake | back to summary |
|---|---|
| private void receiveHandshake() throws IOException | |
| sendConnect | back to summary |
|---|---|
| private void sendConnect() | |
| sendHandshake | back to summary |
|---|---|
| private void sendHandshake() | |
| tunnel | back to summary |
|---|---|
| private void tunnel() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Socks5Proxy. | |
| public static final Socks5Proxy. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Socks5Proxy. | |
| public static Socks5Proxy. |
| CONNECT | back to summary |
|---|---|
| public static final Socks5Proxy. | |
| HANDSHAKE | back to summary |
|---|---|
| public static final Socks5Proxy. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static Socks5Proxy. | |
| values | back to summary |
|---|---|
| public static Socks5Proxy. | |