netty-websocket-spring-boot-starter
netty-websocket-spring-boot-starter copied to clipboard
无法建立websocket连接,req总是为null
@BeforeHandshake public void handshake(Session session, HttpHeaders headers, @RequestParam String req, @RequestParam MultiValueMap reqMap, @PathVariable String arg, @PathVariable Map pathMap) { session.setSubprotocols("stomp"); if (!"ok".equals(req)) { System.out.println("Authentication failed!"); session.close(); } } 第一次配置还是成功的,过了几天再试,发现不能建立连接了,代码没有改动。
req是客户端传过来的,为null是没传
@RequestParam String req, @RequestParam MultiValueMap reqMap, @PathVariable String arg, @PathVariable Map pathMap 这4个参数可以根据具体业务进行取舍,应该是这里的坑
@YeautyYE ,文档更新下或者说明下吧,要不都得有这个坑
@RequestParam String req, @RequestParam MultiValueMap reqMap, @PathVariable String arg, @PathVariable Map pathMap 这4个参数可以根据具体业务进行取舍,应该是这里的坑
@YeautyYE ,文档更新下或者说明下吧,要不都得有这个坑
OK
req是客户端传过来的,为null是没传
能说一下这req怎么传吗? 我这么传获取不到 ---> ws://127.0.0.1:9999/ws/test?req=ok
req是客户端传过来的,为null是没传
能说一下这req怎么传吗? 我这么传获取不到 ---> ws://127.0.0.1:9999/ws/test?req=ok
是这样传的,你是不是导错包了