Example usage for io.netty.handler.codec.socksx.v5 Socks5ServerEncoder DEFAULT

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

Introduction

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

Prototype

Socks5ServerEncoder DEFAULT

To view the source code for io.netty.handler.codec.socksx.v5 Socks5ServerEncoder DEFAULT.

Click 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();//from  ww  w  .  ja v  a 2  s  .  c om
    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// www . j  a  v  a  2s . 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) };
}