Example usage for io.netty.handler.codec.socksx.v5 Socks5InitialRequestDecoder Socks5InitialRequestDecoder

List of usage examples for io.netty.handler.codec.socksx.v5 Socks5InitialRequestDecoder Socks5InitialRequestDecoder

Introduction

In this page you can find the example usage for io.netty.handler.codec.socksx.v5 Socks5InitialRequestDecoder Socks5InitialRequestDecoder.

Prototype

public Socks5InitialRequestDecoder() 

Source Link

Usage

From source file:com.github.sinsinpub.pero.manual.proxyhandler.Socks5ProxyServer.java

License:Apache License

@Override
protected void configure(SocketChannel ch) throws Exception {
    ChannelPipeline p = ch.pipeline();/* w w w .  j ava  2  s.  co m*/
    switch (testMode) {
    case INTERMEDIARY:
        p.addLast(DECODER, new Socks5InitialRequestDecoder());
        p.addLast(ENCODER, Socks5ServerEncoder.DEFAULT);
        p.addLast(new Socks5IntermediaryHandler());
        break;
    case TERMINAL:
        p.addLast(DECODER, new Socks5InitialRequestDecoder());
        p.addLast(ENCODER, Socks5ServerEncoder.DEFAULT);
        p.addLast(new Socks5TerminalHandler());
        break;
    case UNRESPONSIVE:
        p.addLast(UnresponsiveHandler.INSTANCE);
        break;
    }
}

From source file:com.slyak.services.proxy.server.Socks5ProxyServer.java

License:Apache License

@Override
ChannelHandler[] getCustomChannelHandlers(EventLoopGroup clientGroup) {
    //socks auth/*w  w  w . j a  va 2  s.  c o m*/
    //new Socks5PasswordAuthRequestDecoder();
    //new Socks5PasswordAuthRequestHandler()
    return new ChannelHandler[] {
            //Socks5MessageByteBuf
            Socks5ServerEncoder.DEFAULT,
            //socks5 init
            new Socks5InitialRequestDecoder(), new Socks5InitialRequestHandler(),
            //socks connection
            new Socks5CommandRequestDecoder(), new Socks5CommandRequestHandler(clientGroup) };
}