Top Description Fields Constructors Methods
io.netty.contrib.handler.codec.socksx

public Class SocksPortUnificationServerHandler

extends ByteToMessageDecoder
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, .ChannelPipeline, io.netty.contrib.handler.codec.socksx.v4.Socks4ServerDecoder, .Socks4ServerEncoder, io.netty.contrib.handler.codec.socksx.v5.Socks5AddressEncoder, .Socks5InitialRequestDecoder, .Socks5ServerEncoder, io.netty5.handler.codec.ByteToMessageDecoder, io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory

Detects the version of the current SOCKS connection and initializes the pipeline with Socks4ServerDecoder or Socks5InitialRequestDecoder.

Field Summary

Modifier and TypeField and Description
private static final InternalLogger
private final Socks5ServerEncoder
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
SocksPortUnificationServerHandler()

Creates a new instance with the default configuration.

public
SocksPortUnificationServerHandler(Socks5ServerEncoder socks5encoder)

Creates a new instance with the specified Socks5ServerEncoder.

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, Buffer
the Buffer from which to read data
in
)

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another.
private static void
private static void
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
actualReadableByteschannelInactivechannelReadchannelReadCompletechannelShutdowndecodeLastdiscardSomeReadByteshandlerAddedhandlerAdded0handlerRemovedhandlerRemoved0internalBufferisSharableisSingleDecodesetSingleDecode

Field Detail

loggerback to summary
private static final InternalLogger logger
socks5encoderback to summary
private final Socks5ServerEncoder socks5encoder

Constructor Detail

SocksPortUnificationServerHandlerback to summary
public SocksPortUnificationServerHandler()

Creates a new instance with the default configuration.

SocksPortUnificationServerHandlerback to summary
public SocksPortUnificationServerHandler(Socks5ServerEncoder socks5encoder)

Creates a new instance with the specified Socks5ServerEncoder. This constructor is useful when a user wants to use an alternative Socks5AddressEncoder.

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, Buffer in) throws Exception

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another. This method will be called till either the input Buffer has nothing to read when return from this method or till nothing was read from the input Buffer.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:Buffer

the Buffer from which to read data

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
logKnownVersionback to summary
private static void logKnownVersion(ChannelHandlerContext ctx, SocksVersion version)
logUnknownVersionback to summary
private static void logUnknownVersion(ChannelHandlerContext ctx, byte versionVal)