From 748117e97e17a3717ca9fb7443168b0b1e170b71 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Fri, 25 Aug 2023 10:25:58 +0800 Subject: [PATCH] =?UTF-8?q?websocket=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 ++ .../xtong/zhbs/configure/WebSocketConfig.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/main/java/com/xtong/zhbs/configure/WebSocketConfig.java 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(); + } +}