package com.ard.sample.component.websocket.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.socket.server.standard.ServerEndpointExporter; /** * 启用WebSocket支持,注册端点处理器 */ @Configuration public class WebSocketDockConfig { // 自动注册@ServerEndpoint注解的类 @Bean public ServerEndpointExporter serverEndpointExporter() { return new ServerEndpointExporter(); } }