@@ -0,0 +1,1675 @@
+package pro.simpleproject.core.intra.server;%0A%0Aimport io.netty.bootstrap.ServerBootstrap;%0Aimport io.netty.channel.Channel;%0Aimport io.netty.channel.ChannelInitializer;%0Aimport io.netty.channel.ChannelPipeline;%0Aimport io.netty.channel.EventLoopGroup;%0Aimport io.netty.channel.nio.NioEventLoopGroup;%0Aimport io.netty.channel.socket.SocketChannel;%0Aimport io.netty.channel.socket.nio.NioServerSocketChannel;%0Aimport io.netty.handler.ssl.SslContext;%0Aimport io.netty.handler.ssl.SslContextBuilder;%0Aimport io.netty.handler.ssl.util.SelfSignedCertificate;%0A%0Apublic class Server %7B%0A%0A%09private int port;%0A%09private EventLoopGroup bossGroup;%0A%09private EventLoopGroup workerGroup;%0A%09private Channel channel;%0A%0A%09public Server(int port) %7B%0A%09%09this.port = port;%0A%09%7D%0A%0A%09public void run() throws Exception %7B%0A%09%09SelfSignedCertificate ssc = new SelfSignedCertificate();%0A%09%09SslContext sslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()).build();%0A%0A%09%09bossGroup = new NioEventLoopGroup(1);%0A%09%09workerGroup = new NioEventLoopGroup(5);%0A%0A%09%09try %7B%0A%09%09%09ServerBootstrap b = new ServerBootstrap();%0A%09%09%09b.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class)%0A%09%09%09%09%09.childHandler(new ChannelInitializer%3CSocketChannel%3E() %7B%0A%0A%09%09%09%09%09%09@Override%0A%09%09%09%09%09%09protected void initChannel(SocketChannel ch) throws Exception %7B%0A%09%09%09%09%09%09%09ChannelPipeline pipeline = ch.pipeline();%0A%09%09%09%09%09%09%09pipeline.addLast(sslCtx.newHandler(ch.alloc()));%0A%09%09%09%09%09%09%09pipeline.addLast(new ServerHandler());%0A%09%09%09%09%09%09%7D%0A%0A%09%09%09%09%09%7D);%0A%09%09%09channel = b.bind(port).sync().channel();%0A%09%09%09channel.closeFuture().sync();%0A%09%09%7D finally %7B%0A%09%09%09bossGroup.shutdownGracefully();%0A%09%09%09workerGroup.shutdownGracefully();%0A%09%09%7D%0A%09%7D%0A%0A%09public void close() %7B%0A%09%09channel.close();%0A%09%7D%0A%0A%7D%0A

Create Server.java