| | |
| | | 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("与客户端建立连接,通道开启!"); |
| | |
| | | //如果url包含参数,需要处理 |
| | | if(uri.contains("?")){ |
| | | String newUri=uri.substring(0,uri.indexOf("?")); |
| | | System.out.println(newUri); |
| | | request.setUri(newUri); |
| | | } |
| | | |
| | |
| | | }else{ |
| | | return map; |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |