Top Inners Constructors Methods
org.eclipse.jetty.client

public Class Socks4Proxy

extends Proxy
Class Inheritance
Imports
java.io.IOException, java.net.InetSocketAddress, java.nio.ByteBuffer, java.nio.charset.StandardCharsets, java.util.Map, java.util.concurrent.Executor, .TimeoutException, java.util.regex.Matcher, .Pattern, org.eclipse.jetty.io.AbstractConnection, .ClientConnectionFactory, .ClientConnector, .EndPoint, org.eclipse.jetty.util.BufferUtil, .Callback, .Promise, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class

Constructor Summary

AccessConstructor and Description
public
Socks4Proxy(String host, int port)

public
Socks4Proxy(Origin.Address address, boolean secure)

Method Summary

Modifier and TypeMethod and Description
public ClientConnectionFactory
Inherited from org.eclipse.jetty.client.ProxyConfiguration.Proxy:
getAddressgetExcludedAddressesgetIncludedAddressesgetOrigingetProtocolgetSslContextFactorygetURIisSecurematchestoString

Constructor Detail

Socks4Proxyback to summary
public Socks4Proxy(String host, int port)
Socks4Proxyback to summary
public Socks4Proxy(Origin.Address address, boolean secure)

Method Detail

newClientConnectionFactoryback to summary
public ClientConnectionFactory newClientConnectionFactory(ClientConnectionFactory connectionFactory)

Implements abstract org.eclipse.jetty.client.ProxyConfiguration.Proxy.newClientConnectionFactory.

Parameters
connectionFactory:ClientConnectionFactory

Doc from org.eclipse.jetty.client.ProxyConfiguration.Proxy.newClientConnectionFactory.

the nested ClientConnectionFactory

Returns:ClientConnectionFactory

Doc from org.eclipse.jetty.client.ProxyConfiguration.Proxy.newClientConnectionFactory.

a new ClientConnectionFactory for this Proxy

Annotations
@Override
org.eclipse.jetty.client back to summary

public Class Socks4Proxy.Socks4ProxyClientConnectionFactory

extends Object
implements ClientConnectionFactory
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.client.Socks4Proxy.Socks4ProxyClientConnectionFactory
All Implemented Interfaces
org.eclipse.jetty.io.ClientConnectionFactory

Field Summary

Modifier and TypeField and Description
private final ClientConnectionFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Connection
newConnection(EndPoint
the org.eclipse.jetty.io.EndPoint to link the newly created connection to
endPoint
,
Map<String, Object>
the context data to create the connection
context
)

Implements org.eclipse.jetty.io.ClientConnectionFactory.newConnection.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionFactoryback to summary
private final ClientConnectionFactory connectionFactory

Constructor Detail

Socks4ProxyClientConnectionFactoryback to summary
public Socks4ProxyClientConnectionFactory(ClientConnectionFactory connectionFactory)

Method Detail

newConnectionback to summary
public Connection newConnection(EndPoint endPoint, Map<String, Object> context)

Implements org.eclipse.jetty.io.ClientConnectionFactory.newConnection.

Parameters
endPoint:EndPoint

Doc from org.eclipse.jetty.io.ClientConnectionFactory.newConnection.

the org.eclipse.jetty.io.EndPoint to link the newly created connection to

context:Map<String, Object>

Doc from org.eclipse.jetty.io.ClientConnectionFactory.newConnection.

the context data to create the connection

Returns:Connection

Doc from org.eclipse.jetty.io.ClientConnectionFactory.newConnection.

a new Connection

Annotations
@Override
org.eclipse.jetty.client back to summary

private Class Socks4Proxy.Socks4ProxyConnection

extends AbstractConnection
implements Callback
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.thread.Invocable

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final ClientConnectionFactory
private final Map<String, Object>
private static final Pattern
private static final Logger
private final Socks4Proxy.Socks4ProxyConnection.Socks4Parser

Constructor Summary

AccessConstructor and Description
public
Socks4ProxyConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map<String, Object> context)

Method Summary

Modifier and TypeMethod and Description
public void
failed(Throwable
the reason for the operation failure
x
)

Overrides default org.eclipse.jetty.util.Callback.failed.

Callback invoked when the operation fails.

public void
onFillable()

Implements abstract org.eclipse.jetty.io.AbstractConnection.onFillable.

Callback method invoked when the endpoint is ready to be read.

public boolean
onIdleExpired(TimeoutException timeout)

Overrides org.eclipse.jetty.io.AbstractConnection.onIdleExpired.

Implements org.eclipse.jetty.io.Connection.onIdleExpired.

Callback method invoked upon an idle timeout event.

public void
onOpen()

Overrides org.eclipse.jetty.io.AbstractConnection.onOpen.

Implements org.eclipse.jetty.io.Connection.onOpen.

Callback method invoked when this connection is opened.

private void
onSocks4Response(int responseCode)

public void
succeeded()

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

private void
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.

Inherited from org.eclipse.jetty.io.AbstractConnection:
addEventListenerclosefailedCallbackfillInterestedgetBytesIngetBytesOutgetCreatedTimeStampgetEndPointgetExecutorgetInputBufferSizegetInvocationTypegetMessagesIngetMessagesOutisFillInterestedonCloseonFillInterestedFailedonReadTimeoutremoveEventListenersetInputBufferSizetoConnectionStringtoStringtryFillInterested

Field Detail

connectionFactoryback to summary
private final ClientConnectionFactory connectionFactory
contextback to summary
private final Map<String, Object> context
IPv4_PATTERNback to summary
private static final Pattern IPv4_PATTERN
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.AbstractConnection.LOG.

parserback to summary
private final Socks4Proxy.Socks4ProxyConnection.Socks4Parser parser

Constructor Detail

Socks4ProxyConnectionback to summary
public Socks4ProxyConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map<String, Object> context)

Method Detail

failedback to summary
public void failed(Throwable x)

Overrides default org.eclipse.jetty.util.Callback.failed.

Doc from org.eclipse.jetty.util.Callback.failed.

Callback invoked when the operation fails.

Parameters
x:Throwable

the reason for the operation failure

Annotations
@Override
onFillableback to summary
public void onFillable()

Implements abstract org.eclipse.jetty.io.AbstractConnection.onFillable.

Doc from org.eclipse.jetty.io.AbstractConnection.onFillable.

Callback method invoked when the endpoint is ready to be read.

Annotations
@Override
onIdleExpiredback to summary
public boolean onIdleExpired(TimeoutException timeout)

Overrides org.eclipse.jetty.io.AbstractConnection.onIdleExpired.

Implements org.eclipse.jetty.io.Connection.onIdleExpired.

Doc from org.eclipse.jetty.io.Connection.onIdleExpired.

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.

Returns:boolean

true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.

Annotations
@Override
onOpenback to summary
public void onOpen()

Overrides org.eclipse.jetty.io.AbstractConnection.onOpen.

Implements org.eclipse.jetty.io.Connection.onOpen.

Doc from org.eclipse.jetty.io.Connection.onOpen.

Callback method invoked when this connection is opened.

Creators of the connection implementation are responsible for calling this method.

Annotations
@Override
onSocks4Responseback to summary
private void onSocks4Response(int responseCode) throws IOException
succeededback to summary
public void succeeded()

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Doc from org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

Annotations
@Override
tunnelback to summary
private void tunnel()
writeSocks4Connectback to summary
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.

org.eclipse.jetty.client back to summary

private Class Socks4Proxy.Socks4ProxyConnection.Socks4Parser

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.client.Socks4Proxy.Socks4ProxyConnection.Socks4Parser

Field Summary

Modifier and TypeField and Description
private int
private static final int
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private int
private boolean
parse(ByteBuffer buffer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cursorback to summary
private int cursor
EXPECTED_LENGTHback to summary
private static final int EXPECTED_LENGTH
responseback to summary
private int response

Constructor Detail

Socks4Parserback to summary
private Socks4Parser()

Method Detail

expectedback to summary
private int expected()
parseback to summary
private boolean parse(ByteBuffer buffer) throws IOException