websocket 、stomp关系
来源:互联网 发布:网络课影视鉴赏答案 编辑:程序博客网 时间:2024/05/22 05:01
项目已经用websocket的时间很长了,但是只会用,并不知道这其中的关系。
今天看到spring refernce中解释如下
WebSocket does imply a messaging architecture but does not mandate the use of any specific messaging protocol. It is a very thin layer over TCP that transforms a stream of bytes into a stream of messages (either text or binary) and not much more. It is up to applications to interpret the meaning of a message.
Unlike HTTP, which is an application-level protocol, in the WebSocket protocol there is simply not enough information in an incoming message for a framework or container to know how to route it or process it. Therefore WebSocket is arguably too low level for anything but a very trivial application. It can be done, but it will likely lead to creating a framework on top. This is comparable to how most web applications today are written using a web framework rather than the Servlet API alone.
For this reason the WebSocket RFC defines the use of sub-protocols. During the handshake, the client and server can use the header Sec-WebSocket-Protocol to agree on a sub-protocol, i.e. a higher, application-level protocol to use. The use of a sub-protocol is not required, but even if not used, applications will still need to choose a message format that both the client and server can understand. That format can be custom, framework-specific, or a standard messaging protocol.
The Spring Framework provides support for using STOMP — a simple, messaging protocol originally created for use in scripting languages with frames inspired by HTTP. STOMP is widely supported and well suited for use over WebSocket and over the web.
三言两语说下他们的关系,websocket协议因为其包体包含信息较少,所以并不像是HTTP那样包含了很多的信息,他就是一串简单的文本, 而stomp协议可以解决这个问题。并且支持比较广泛。
具体可以参考官网
http://stomp.github.io/stomp-specification-1.2.html
- websocket 、stomp关系
- WebSocket与STOMP介绍
- STOMP Over WebSocket原文
- Spring websocket stomp
- STOMP-WebSocket中文文档
- WebSocket+STOMP+SockJS
- Spring websocket over STOMP使用指南
- ANDROID WebSocket+STOMP 1.0版本
- Stomp Over Websocket的Spring实现
- Spring boot WebSocket stomp简单例子
- stomp over websocket协议原理与实现
- Spring4.3.3 WebSocket-STOMP协议集成 (2)-WebSocket-stomp子协议通讯小栗子
- Spring4.3.3 WebSocket-STOMP协议集成 (2.1)-WebSocket-stomp子协议通讯小栗子
- STOMP
- AngularJs + sockjs + stomp 报错websocket连接失败
- spring websocket + stomp 实现广播通信和一对一通信
- spring websocket stomp如何向服务端传递参数
- springmvc(18)使用WebSocket 和 STOMP 实现消息功能
- 常用的工业流程控制伪代码
- 程序员笔试之智力题(持续更新)
- ALM(QC)在汉化的情况下,网页登录时仍然显示为英文并报错的配置方法
- 矩形覆盖(递归 循环)
- 小程序的积累1
- websocket 、stomp关系
- 我理解的数字证书-1-公钥,私钥和数字证书
- Windows下通过bat批处理文件和vbs脚本实现守护进程
- activity blog
- matlab 教程 (一)
- leetcode题解-73. Set Matrix Zeroes
- C#导出数据到Excel的几种方法
- 如何设置同一网段IP
- centos管理经验