https://netty.io/4.1/xref/io/netty/example/proxy/package-summary.html
https://netty.io/4.1/xref/io/netty/example/proxy/HexDumpProxy.html
package com.test;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
public class HexDumpProxyInitializer extends ChannelInitializer {
private final String remoteHost;
private final int remotePort;
public HexDumpProxyInitializer(String remoteHost, int remotePort) {
this.remoteHost = remoteHost;
this.remotePort = remotePort;
}
@Override
public void initChannel(SocketChannel ch) {
// 获取当前类名;
System.out.println(this.getClass());
ch.pipeline().addLast(
new LoggingHandler(LogLevel.INFO