12345678910111213141516171819202122232425 |
- package com.fdkankan.fusion.websocket;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.web.socket.config.annotation.EnableWebSocket;
- import org.springframework.web.socket.server.standard.ServerEndpointExporter;
- /**
- * SpringBoot + WebSocket 是用@ServerEndpoint注入,必须有此配置
- *
- */
- @Configuration
- public class WebSocketConfig {
- @Bean
- public ServerEndpointExporter serverEndpointExporter() {
- return new ServerEndpointExporter();
- }
- }
|