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.NestedNested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeToNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.InvocationType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientConnectionFactoryprivate static final Patternprivate static final Loggerprivate final Socks4Proxy.Socks4ProxyConnection.Socks4ParserFields 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 TypeMethodDescriptionvoidCallback invoked when the operation fails.voidCallback method invoked when the endpoint is ready to be read.voidonOpen()Callback method invoked when this connection is opened.private voidonSocks4Response(int responseCode) voidCallback invoked when the operation completes.private voidtunnel()private voidWrites 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, tryFillInterestedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin 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:CallbackCallback invoked when the operation completes.
-
failed
Description copied from interface:CallbackCallback invoked when the operation fails.
-
onFillable
public void onFillable()Description copied from class:AbstractConnectionCallback method invoked when the endpoint is ready to be read.
- Specified by:
onFillablein classAbstractConnection- See Also:
-
onSocks4Response
- Throws:
IOException
-
tunnel
private void tunnel()
-