下面是一个 Spring Boot 集成 WebSocket 的简单案例:
- 在项目中添加对 websocket 的支持,例如通过 Maven 在 pom.xml 中添加以下依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
下面是一个 Spring Boot 集成 WebSocket 的简单案例:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>