WebSocket connection to 'ws://192.168.10.129:8082/websocket' failed: Error during WebSocket handshake: Unexpected response code: 200
WebSocketHandler Handler { ; Pattern ; WebSocketHandler(String wsUrlPrefix, devMode) { .= devMode; = Pattern.(wsUrlPrefix); } handle(String target, HttpServletRequest request, HttpServletResponse response, [] isHandled) { (.matcher(target).find()) { ; } .handle(target, request, response, isHandled); } }
; ; ; ; javax.websocket.Session; ; java.io.IOException; () WebSocketCtrl { onOpen(Session session) { System..println(+ session.getId()); } onClose(Session session) { System..println(+ session.getId()); } onError(Session session, Throwable error) { System..println(+ session.getId()); error.printStackTrace(); } onMessage(String requestJson, Session session) { { session.getBasicRemote().sendText(requestJson); } (IOException e) { e.printStackTrace(); } } }
new WebSocketHandler("^/websocket");
var ws = new WebSocket("ws://192.168.10.129:8082/websocket");
好像不进入
@ServerEndpoint("/websocket")
注解注册的类里面
项目:JFinal