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:
java.io.Closeable,java.lang.AutoCloseable,Connection,Callback,Invocable
- Enclosing class:
- Socks4Proxy
private static class Socks4Proxy.Socks4ProxyConnection extends AbstractConnection implements Callback
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSocks4Proxy.Socks4ProxyConnection.Socks4Parser-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, 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
Fields Modifier and Type Field Description private ClientConnectionFactoryconnectionFactoryprivate java.util.Map<java.lang.String,java.lang.Object>contextprivate static java.util.regex.PatternIPv4_PATTERNprivate static LoggerLOGprivate Socks4Proxy.Socks4ProxyConnection.Socks4Parserparser-
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking
-
-
Constructor Summary
Constructors Constructor Description Socks4ProxyConnection(EndPoint endPoint, java.util.concurrent.Executor executor, ClientConnectionFactory connectionFactory, java.util.Map<java.lang.String,java.lang.Object> context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfailed(java.lang.Throwable x)Callback invoked when the operation fails.voidonFillable()Callback method invoked when the endpoint is ready to be read.voidonOpen()Callback method invoked when this connection is opened.private voidonSocks4Response(int responseCode)voidsucceeded()Callback invoked when the operation completes.private voidtunnel()private voidwriteSocks4Connect()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 Detail
-
IPv4_PATTERN
private static final java.util.regex.Pattern IPv4_PATTERN
-
LOG
private static final Logger LOG
-
parser
private final Socks4Proxy.Socks4ProxyConnection.Socks4Parser parser
-
connectionFactory
private final ClientConnectionFactory connectionFactory
-
context
private final java.util.Map<java.lang.String,java.lang.Object> context
-
-
Constructor Detail
-
Socks4ProxyConnection
public Socks4ProxyConnection(EndPoint endPoint, java.util.concurrent.Executor executor, ClientConnectionFactory connectionFactory, java.util.Map<java.lang.String,java.lang.Object> context)
-
-
Method Detail
-
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.
- Specified by:
succeededin interfaceCallback- See Also:
Callback.failed(Throwable)
-
failed
public void failed(java.lang.Throwable x)
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:
AbstractConnection.fillInterested()
-
onSocks4Response
private void onSocks4Response(int responseCode) throws java.io.IOException- Throws:
java.io.IOException
-
tunnel
private void tunnel()
-
-