@Override
    public void afterConnectionEstablished(final WebSocketSession session) throws Exception {
        LOG.info("The connection has been established successfully.");
        Object token = session.getAttributes().get("token");
        if (Objects.nonNull(token)) {
            // The user is successfully connected and put into the online user cache.
            WsSessionManager.add(token.toString(), session);
        } else {
            throw new RuntimeException("User login has expired!");
        }
    }
socket create a success event.

@param session session
@throws Exception exception
shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/handler/HttpAuthHandler.java