liusuyi
2025-10-28 d224735ba7c3b9a0e9df3699c9c1fad1202e576d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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();
    }
}