javascript - The information received by WebSocket is binary. How to parse it?
天蓬老师
天蓬老师 2017-05-16 13:44:39
0
1
916

I grabbed other people’s ws information and got Blob type data. How should I parse it??

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
仅有的幸福

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template