xin.alum.aim.coder.SocksEncoder Maven / Gradle / Ivy
package xin.alum.aim.coder;
import io.netty.util.ReferenceCountUtil;
import xin.alum.aim.config.DataAgreement;
import xin.alum.aim.constant.AIMConstant;
import xin.alum.aim.constant.ChannelAttr;
import xin.alum.aim.model.Transportable;
import xin.alum.aim.util.JSONUtils;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import io.netty.handler.codec.ReplayingDecoder;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import java.nio.charset.StandardCharsets;
import java.security.InvalidParameterException;
import java.util.List;
public class SocksEncoder extends MessageToMessageEncoder {
protected final InternalLogger logger = InternalLoggerFactory.getInstance(this.getClass());
@Override
protected void encode(ChannelHandlerContext ctx, Transportable in, List