zhaowenyu
2025-10-17 6516ddc56b7ddf971bb8faef2500ee951f7aa835
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();
    }
}