Yunite is routing 100% of its traffic through Cloudflare. Cloudflare terminates idle connections after 100 seconds, so our API service is regularly sending pings through an open WebSocket connection. To make it easier for you and us to differentiate between payload data and pings on the WebSocket message stream, we introduced opcodes.
All WebSocket messages have a field called
op indicating the type of the message. Other contents of the message depend on this opcode.
Here's an overview of our opcodes:
Code 0 means ping. At the moment, you don't have to respond to pings; this might change in the future. Right now, you can just drop it.
data fields contain a counter that is incremented by 1 for each ping.
Code 1 means payload data. This is usually what you're looking for.
In our documentation, all WebSocket message schemas only define the contents of the
data field. We do not specify
"op": 1 explicitly anywhere but here.