webSocket

1、导入依赖


org.springframework.boot
spring-boot-starter-websocket

2、编写配置类
@Configuration
public class WebSocketConfig {
/**
* 注入一个ServerEndpointExporter,该Bean会自动注册使用@ServerEndpoint注解申明的websocket endpoint
*/
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerE

webSocket最先出现在Python成神之路

版权声明:
作者:玉兰
链接:https://www.techfm.club/p/8215.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>