Top Description Fields Constructors Methods
io.netty.handler.proxy

public final Class Socks4ProxyHandler

extends ProxyHandler
Class Inheritance
Imports
io.netty.channel.ChannelHandlerContext, .ChannelPipeline, io.netty.handler.codec.socksx.v4.DefaultSocks4CommandRequest, .Socks4ClientDecoder, .Socks4ClientEncoder, .Socks4CommandResponse, .Socks4CommandStatus, .Socks4CommandType, java.net.InetSocketAddress, .SocketAddress

Handler that establishes a blind forwarding proxy tunnel using SOCKS4 protocol.

Field Summary

Modifier and TypeField and Description
private static final String
private String
private String
private static final String
private final String
Inherited from io.netty.handler.proxy.ProxyHandler:
AUTH_NONE

Constructor Summary

AccessConstructor and Description
public
public
Socks4ProxyHandler(SocketAddress proxyAddress, String username)

Method Summary

Modifier and TypeMethod and Description
protected void
addCodec(ChannelHandlerContext ctx)

Implements abstract io.netty.handler.proxy.ProxyHandler.addCodec.

Adds the codec handlers required to communicate with the proxy server.
public String
authScheme()

Implements abstract io.netty.handler.proxy.ProxyHandler.authScheme.

Returns the name of the authentication scheme in use.
protected boolean
handleResponse(ChannelHandlerContext ctx, Object response)

Implements abstract io.netty.handler.proxy.ProxyHandler.handleResponse.

Handles the message received from the proxy server.
protected Object
newInitialMessage(ChannelHandlerContext ctx)

Implements abstract io.netty.handler.proxy.ProxyHandler.newInitialMessage.

Returns a new message that is sent at first time when the connection to the proxy server has been established.
public String
protocol()

Implements abstract io.netty.handler.proxy.ProxyHandler.protocol.

Returns the name of the proxy protocol in use.
protected void
protected void
public String
Inherited from io.netty.handler.proxy.ProxyHandler:
channelActivechannelInactivechannelReadchannelReadCompleteconnectconnectFutureconnectTimeoutMillisdestinationAddressexceptionCaughtexceptionMessageflushhandlerAddedisConnectedproxyAddresssendToProxyServersetConnectTimeoutMilliswrite

Field Detail

AUTH_USERNAMEback to summary
private static final String AUTH_USERNAME
decoderNameback to summary
private String decoderName
encoderNameback to summary
private String encoderName
PROTOCOLback to summary
private static final String PROTOCOL
usernameback to summary
private final String username

Constructor Detail

Socks4ProxyHandlerback to summary
public Socks4ProxyHandler(SocketAddress proxyAddress)
Socks4ProxyHandlerback to summary
public Socks4ProxyHandler(SocketAddress proxyAddress, String username)

Method Detail

addCodecback to summary
protected void addCodec(ChannelHandlerContext ctx) throws Exception

Implements abstract io.netty.handler.proxy.ProxyHandler.addCodec.

Doc from io.netty.handler.proxy.ProxyHandler.addCodec.

Adds the codec handlers required to communicate with the proxy server.

Annotations
@Override
authSchemeback to summary
public String authScheme()

Implements abstract io.netty.handler.proxy.ProxyHandler.authScheme.

Doc from io.netty.handler.proxy.ProxyHandler.authScheme.

Returns the name of the authentication scheme in use.

Annotations
@Override
handleResponseback to summary
protected boolean handleResponse(ChannelHandlerContext ctx, Object response) throws Exception

Implements abstract io.netty.handler.proxy.ProxyHandler.handleResponse.

Doc from io.netty.handler.proxy.ProxyHandler.handleResponse.

Handles the message received from the proxy server.

Returns:boolean

true if the connection to the destination has been established, false if the connection to the destination has not been established and more messages are expected from the proxy server

Annotations
@Override
newInitialMessageback to summary
protected Object newInitialMessage(ChannelHandlerContext ctx) throws Exception

Implements abstract io.netty.handler.proxy.ProxyHandler.newInitialMessage.

Doc from io.netty.handler.proxy.ProxyHandler.newInitialMessage.

Returns a new message that is sent at first time when the connection to the proxy server has been established.

Returns:Object

the initial message, or null if the proxy server is expected to send the first message instead

Annotations
@Override
protocolback to summary
public String protocol()

Implements abstract io.netty.handler.proxy.ProxyHandler.protocol.

Doc from io.netty.handler.proxy.ProxyHandler.protocol.

Returns the name of the proxy protocol in use.

Annotations
@Override
removeDecoderback to summary
protected void removeDecoder(ChannelHandlerContext ctx) throws Exception

Implements abstract io.netty.handler.proxy.ProxyHandler.removeDecoder.

Doc from io.netty.handler.proxy.ProxyHandler.removeDecoder.

Removes the decoders added in addCodec(ChannelHandlerContext).

Annotations
@Override
removeEncoderback to summary
protected void removeEncoder(ChannelHandlerContext ctx) throws Exception

Implements abstract io.netty.handler.proxy.ProxyHandler.removeEncoder.

Doc from io.netty.handler.proxy.ProxyHandler.removeEncoder.

Removes the encoders added in addCodec(ChannelHandlerContext).

Annotations
@Override
usernameback to summary
public String username()