ny
昨天 b6f169fe43a2b13f351aefc152374fc7f0bc8cb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package jnpf.message.config;
 
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeployment;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
 
 
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class WebsocketConfig {
 
    /**
     * 支持websocket
     * 如果不使用内置tomcat,则无需配置
     *
     * @return
     */
    @Bean
    @ConditionalOnNotWarDeployment
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}