STOMP

WebSocket 协议定义了两种类型的消息(文本和二进制),但其内容是未定义的。该协议定义了客户端和服务器用来协商子协议(即 WebSocket 之上的高级消息协议)的一种机制,该协议用于定义每个客户端可以发送的消息类型、格式、每个消息的内容等。子协议的使用是可选的,但无论哪种方式,客户端和服务器都需要就定义消息内容的某个协议达成一致。

The WebSocket protocol defines two types of messages (text and binary), but their content is undefined. The protocol defines a mechanism for client and server to negotiate a sub-protocol (that is, a higher-level messaging protocol) to use on top of WebSocket to define what kind of messages each can send, what the format is, the content of each message, and so on. The use of a sub-protocol is optional but, either way, the client and the server need to agree on some protocol that defines message content.