WebSocketConfig.java
532 Bytes
package com.viontech.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/***
* 当使用springboot启动时打开即可 不然websocket不起作用 若是使用tomcat启动则必须关闭
*/
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}