Although websocket is based on TCP, a protocol on the same layer as HTTP, its frame structure is indeed quite complicated, but what can be done? . . The following article has an introduction to the frame structure of websocket. Those who are familiar with binary operations can follow the analysis. Learn the WebSocket protocol - the implementation principle from the top to the bottom If you are not familiar with the binary protocol, just use the algorithm provided online. Here is a PHP version for reference: WEBsocket Chat Room
Although websocket is based on TCP, a protocol on the same layer as HTTP, its frame structure is indeed quite complicated, but what can be done? . .
The following article has an introduction to the frame structure of websocket. Those who are familiar with binary operations can follow the analysis.
Learn the WebSocket protocol - the implementation principle from the top to the bottom
If you are not familiar with the binary protocol, just use the algorithm provided online. Here is a PHP version for reference:
WEBsocket Chat Room