From cfb0adfc8944e45131d4a430f790c48399e677c5 Mon Sep 17 00:00:00 2001 From: wujiawei <12345678> Date: Mon, 8 Jan 2024 16:51:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=9C=8D=E5=8A=A1=E7=AB=AF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BF=83=E8=B7=B3=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../netty/proxy/client/proxy/NettyProxyAutoConfiguration.java | 1 + .../main/java/com/lazy/netty/proxy/server/ServerSocket.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lazy-netty-proxy-client/src/main/java/com/lazy/netty/proxy/client/proxy/NettyProxyAutoConfiguration.java b/lazy-netty-proxy-client/src/main/java/com/lazy/netty/proxy/client/proxy/NettyProxyAutoConfiguration.java index 9ebb8ac..e826f68 100644 --- a/lazy-netty-proxy-client/src/main/java/com/lazy/netty/proxy/client/proxy/NettyProxyAutoConfiguration.java +++ b/lazy-netty-proxy-client/src/main/java/com/lazy/netty/proxy/client/proxy/NettyProxyAutoConfiguration.java @@ -27,6 +27,7 @@ public class NettyProxyAutoConfiguration { Constant.serverIp = clientProxyConfigurationProperties.getServerIp(); Constant.serverPort = clientProxyConfigurationProperties.getServerPort(); Constant.realPort = serverProperties.getPort(); + Constant.realPort = 28080; log.info("netty客户端连接服务端IP:{},服务端端口:{},客户端自己的端口:{}",Constant.serverIp,Constant.serverPort,Constant.realPort); diff --git a/lazy-netty-proxy-server/src/main/java/com/lazy/netty/proxy/server/ServerSocket.java b/lazy-netty-proxy-server/src/main/java/com/lazy/netty/proxy/server/ServerSocket.java index f0a35e4..ac2e760 100644 --- a/lazy-netty-proxy-server/src/main/java/com/lazy/netty/proxy/server/ServerSocket.java +++ b/lazy-netty-proxy-server/src/main/java/com/lazy/netty/proxy/server/ServerSocket.java @@ -4,7 +4,6 @@ import com.lazy.netty.proxy.msg.MyMsgDecoder; import com.lazy.netty.proxy.msg.MyMsgEncoder; import com.lazy.netty.proxy.server.handler.ClientHandler; import com.lazy.netty.proxy.server.handler.HeartBeatServerHandler; -import com.lazy.netty.proxy.server.handler.LazyServerIdleStateHandler; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; @@ -34,7 +33,7 @@ public class ServerSocket { pipeline.addLast(new MyMsgDecoder(Integer.MAX_VALUE, 0, 4, -4, 0)); pipeline.addLast(new MyMsgEncoder()); pipeline.addLast(new IdleStateHandler(40, 10, 0)); - pipeline.addLast(new LazyServerIdleStateHandler(40, 10, 0)); +// pipeline.addLast(new LazyServerIdleStateHandler(40, 10, 0)); pipeline.addLast(new ClientHandler()); pipeline.addLast(new HeartBeatServerHandler()); }