1
zj
2024-08-07 7b73a544cec17c05b5931cf6c2b5cdf598e127b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package project.web.websocket;
 
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
 
/**
 * 给spring容器注入这个ServerEndpointExporter对象
 * 
 * 检测所有带有@serverEndpoint注解的bean并注册他们。
 */
@Configuration
public class WebSocketConfig {
 
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}