Examples of Socks5AuthResponse


Examples of io.netty.handler.codec.socksx.v5.Socks5AuthResponse

                        ctx.write(new Socks5InitResponse(Socks5AuthScheme.NO_AUTH));
                        break;
                    }
                    case AUTH:
                        ctx.pipeline().addFirst(new Socks5CmdRequestDecoder());
                        ctx.write(new Socks5AuthResponse(Socks5AuthStatus.SUCCESS));
                        break;
                    case CMD:
                        Socks5CmdRequest socks5CmdRequest = (Socks5CmdRequest) socksRequest;
                        if (socks5CmdRequest.cmdType() == Socks5CmdType.CONNECT) {
                            ctx.pipeline().addLast(new SocksServerConnectHandler());
View Full Code Here

Examples of io.netty.handler.codec.socksx.v5.Socks5AuthResponse

        }

        Socks5AuthRequest req = (Socks5AuthRequest) msg;
        if (req.username().equals(username) && req.password().equals(password)) {
            ctx.pipeline().addBefore("encoder", "decoder", new Socks5CmdRequestDecoder());
            ctx.write(new Socks5AuthResponse(Socks5AuthStatus.SUCCESS));
            return true;
        }

        ctx.pipeline().addBefore("encoder", "decoder", new Socks5AuthRequestDecoder());
        ctx.write(new Socks5AuthResponse(Socks5AuthStatus.FAILURE));
        return false;
    }
View Full Code Here

Examples of io.netty.handler.codec.socksx.v5.Socks5AuthResponse

            return false;
        }

        if (response instanceof Socks5AuthResponse) {
            // Received an authentication response from the server.
            Socks5AuthResponse res = (Socks5AuthResponse) response;
            if (res.authStatus() != Socks5AuthStatus.SUCCESS) {
                throw new ProxyConnectException(exceptionMessage("authStatus: " + res.authStatus()));
            }

            sendConnectCommand(ctx);
            return false;
        }

        // This should be the last message from the server.
        Socks5CmdResponse res = (Socks5CmdResponse) response;
        if (res.cmdStatus() != Socks5CmdStatus.SUCCESS) {
            throw new ProxyConnectException(exceptionMessage("cmdStatus: " + res.cmdStatus()));
        }

        return true;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.