private void handleCommandRequest(ChannelHandlerContext ctx, final Socks5CommandRequest commandRequest) { if (commandRequest.type().equals(Socks5CommandType.CONNECT)) { forwardConnection(ctx, new Socks5ConnectHandler(server, mockServerLogger, commandRequest.dstAddr(), commandRequest.dstPort()), commandRequest.dstAddr(), commandRequest.dstPort()); ctx.fireChannelRead(commandRequest); } else { ctx.writeAndFlush(new DefaultSocks5CommandResponse(Socks5CommandStatus.COMMAND_UNSUPPORTED, Socks5AddressType.DOMAIN, "", 0)).addListener(ChannelFutureListener.CLOSE); } } }
private void handleCommandRequest(ChannelHandlerContext ctx, final Socks5CommandRequest commandRequest) { if (commandRequest.type().equals(Socks5CommandType.CONNECT)) { forwardConnection(ctx, new Socks5ConnectHandler(server, mockServerLogger, commandRequest.dstAddr(), commandRequest.dstPort()), commandRequest.dstAddr(), commandRequest.dstPort()); ctx.fireChannelRead(commandRequest); } else { ctx.writeAndFlush(new DefaultSocks5CommandResponse(Socks5CommandStatus.COMMAND_UNSUPPORTED, Socks5AddressType.DOMAIN, "", 0)).addListener(ChannelFutureListener.CLOSE); } } }
if (request.type().equals(Socks5CommandType.CONNECT)) { try { handleConnectRequest(ctx, request.dstAddr(), request.dstPort(),
if (request.type().equals(Socks5CommandType.CONNECT)) { try { handleConnectRequest(ctx, request.dstAddr(), request.dstPort(),