Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read a Binary Frame on a Web Socket?

I'm trying to understand the communication between slither.io client and web socket. While I'm reading WS packages the only thing that I can see is "Binary Frame (Opcode 2)". How can I do to read those messages?. Thanks.

like image 266
Martin Avatar asked Apr 29 '16 23:04

Martin


People also ask

Can WebSocket handle binary data?

Data Types and ExtensionsWebSockets support sending binary messages, too. To send binary data, one can use either Blob or ArrayBuffer object. Instead of calling the send method with string, you can simply pass an ArrayBuffer or a Blob .

What is WebSocket binary?

WebSocket enables bidirectional, message-oriented streaming of text and binary data between client and server. It is the closest API to a raw network socket in the browser.

What is WebSockets frame?

A WebSocket frame can be one of 6 types: text , binary , ping , pong , close and continuation . Furthermore, every frame is either a fin frame or not. The first byte of each frame is used to represent the type of frame (known as the op code) as well as whether or not it's a fin frame.


1 Answers

Slither.io uses binary frames to exchange data. As far as I know neither Chrome, nor Firefox allow you to read raw binary data. Try something like wireshark to sniff the traffic.

like image 95
kucherenkovova Avatar answered Oct 14 '22 14:10

kucherenkovova