Package org.eclipse.jetty.client
Class Socks4Proxy.Socks4ProxyConnection
java.lang.Object
org.eclipse.jetty.io.AbstractConnection
org.eclipse.jetty.client.Socks4Proxy.Socks4ProxyConnection
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Connection
,Callback
,Invocable
- Enclosing class:
- Socks4Proxy
private static class Socks4Proxy.Socks4ProxyConnection
extends AbstractConnection
implements Callback
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, Callback.InvocableCallback, Callback.Nested
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.InvocationType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientConnectionFactory
private static final Pattern
private static final Logger
private final Socks4Proxy.Socks4ProxyConnection.Socks4Parser
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking
-
Constructor Summary
ConstructorsConstructorDescriptionSocks4ProxyConnection
(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map<String, Object> context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback invoked when the operation fails.void
Callback method invoked when the endpoint is ready to be read.void
onOpen()
Callback method invoked when this connection is opened.private void
onSocks4Response
(int responseCode) void
Callback invoked when the operation completes.private void
tunnel()
private void
Writes the SOCKS "connect" bytes, differentiating between SOCKS 4 and 4A; the former sends an IPv4 address, the latter the full domain name.Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterested
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.thread.Invocable
getInvocationType
-
Field Details
-
IPv4_PATTERN
-
LOG
-
parser
-
connectionFactory
-
context
-
-
Constructor Details
-
Socks4ProxyConnection
-
-
Method Details
-
onOpen
public void onOpen()Description copied from interface:Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpen
in interfaceConnection
- Overrides:
onOpen
in classAbstractConnection
-
writeSocks4Connect
private void writeSocks4Connect()Writes the SOCKS "connect" bytes, differentiating between SOCKS 4 and 4A; the former sends an IPv4 address, the latter the full domain name. -
succeeded
public void succeeded()Description copied from interface:Callback
Callback invoked when the operation completes.
-
failed
Description copied from interface:Callback
Callback invoked when the operation fails.
-
onFillable
public void onFillable()Description copied from class:AbstractConnection
Callback method invoked when the endpoint is ready to be read.
- Specified by:
onFillable
in classAbstractConnection
- See Also:
-
onSocks4Response
- Throws:
IOException
-
tunnel
private void tunnel()
-