案例一
- 参考
- 案例为
gitee/chnx/springboot/demo01
- 使用springboot + vue + webSocket开发,前后端可连接
- 使用postman测试
# 点击NEW创建一个websocket连接
# 输入连接url: ws://localhost:8080/websocket/DPS007
# new message部分表示客户端发送给服务端的消息,点击send发送
# This is a single message表示的是服务端发送给客户端的消息
案例二
- 参考
- 案例为
gitee/chnx/springboot/demo01
- 使用springboot + vue + webSocket开发,前后端可连接
案例三
- 项目中通常不会使用原生的webSocket,可学习第三方的wenSocket框架
Netty
- 参考guigu-bili