<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
这个jar包是下面的代码要用到的
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
集合websocket我就不多说了,网上全是,随便给个参考链接https://blog.csdn.net/qq_40990836/article/details/83892640
我主要说的是springboot集合进来websocket访问不了的问题,随便记录一下,防止以后遗忘。
这个代码应该是启动websocket代理服务的,猜测是springboot把websocket给代理了,导致访问不到websocket,Spring+Spring MVC+MyBatis就不会导致访问不了了问题,有待大神给出详细解释