diff --git a/pom.xml b/pom.xml index a2e797c..d43c362 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,8 @@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot spring-boot-starter-websocket diff --git a/src/main/java/com/xtong/zhbs/configure/WebSocketConfig.java b/src/main/java/com/xtong/zhbs/configure/WebSocketConfig.java new file mode 100644 index 0000000..5979031 --- /dev/null +++ b/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(); + } +}