Browse Source

websocket 配置项

master
453530270@qq.com 3 years ago
parent
commit
748117e97e
  1. 2
      pom.xml
  2. 16
      src/main/java/com/xtong/zhbs/configure/WebSocketConfig.java

2
pom.xml

@ -21,6 +21,8 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- websocket -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>

16
src/main/java/com/xtong/zhbs/configure/WebSocketConfig.java

@ -0,0 +1,16 @@
package com.xtong.zhbs.configure;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* webscoket configuration
*/
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter(){
return new ServerEndpointExporter();
}
}
Loading…
Cancel
Save