public class NecpWebSocketInterceptor implements HandshakeInterceptor {
Logger logger = LoggerFactory.getLogger(NecpWebSocketInterceptor.class);
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler handle, Map<String, Object> map) throws Exception {
logger.info("啦啦啦,握手开始啦");
return true;
}
@Override
public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler handle, Exception e) {
logger.info("啦啦啦,握手成功啦");
}
}