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 class
Socks4Proxy.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 ClientConnectionFactory
connectionFactory
private java.util.Map<java.lang.String,java.lang.Object>
context
private static java.util.regex.Pattern
IPv4_PATTERN
private static Logger
LOG
private Socks4Proxy.Socks4ProxyConnection.Socks4Parser
parser
-
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 void
failed(java.lang.Throwable x)
Callback invoked when the operation fails.void
onFillable()
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
succeeded()
Callback invoked when the operation completes.private void
tunnel()
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.-
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: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.
- Specified by:
succeeded
in interfaceCallback
- See Also:
Callback.failed(Throwable)
-
failed
public void failed(java.lang.Throwable x)
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:
AbstractConnection.fillInterested()
-
onSocks4Response
private void onSocks4Response(int responseCode) throws java.io.IOException
- Throws:
java.io.IOException
-
tunnel
private void tunnel()
-
-