package com.newfiber.api.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.socket.server.standard.ServerEndpointExporter; /** * @description: WebSocket配置类 * @author: 张鸿志 * @date: 2021/2/22 15:09 * @version: v1.0 */ @Configuration public class WebSocketConfig { /** * @Description: 方法是:该Bean会自动注册会用@ServerEndPoint注解声明的websocket endpoint * @param: * @return: * @author: 张鸿志 * @data: 2021/2/22 15:10 */ @Bean public ServerEndpointExporter serverEndpointExporter(){ return new ServerEndpointExporter(); } }