廖井涛
2025-11-17 fcbce36f8734813b13c8f9c5b26b4bd192274534
north-glass-erp/src/main/java/com/example/erp/tools/netty/MyWebSocketHandler.java
@@ -1,15 +1,8 @@
package com.example.erp.tools.netty;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import java.util.HashMap;
import java.util.Map;
public class MyWebSocketHandler extends SimpleChannelInboundHandler<TextWebSocketFrame> {
public class MyWebSocketHandler  {
   // public class MyWebSocketHandler extends SimpleChannelInboundHandler<TextWebSocketFrame> {
/*
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        System.out.println("与客户端建立连接,通道开启!");
@@ -33,11 +26,10 @@
            String uri = request.uri();
            Map paramMap=getUrlParams(uri);
            System.out.println("接收到的参数是:"+paramMap);
            //System.out.println("接收到的参数是:"+paramMap);
            //如果url包含参数,需要处理
            if(uri.contains("?")){
                String newUri=uri.substring(0,uri.indexOf("?"));
                System.out.println(newUri);
                request.setUri(newUri);
            }
@@ -78,6 +70,6 @@
        }else{
            return map;
        }
    }
    }*/
}