This describes the lowest layer of the protocol, on which the Message Layer rests.
This layer is named the "framing" layer, because its only purpose is to frame messages of higher layers and negotiate basic features for this use case.
The framing layer has two possible states:
CONNECTED. It starts off in
First, the client sends
0x42b33f00 with certain flags set depending on available features:
Afterwards, the client sends a list of all protocols it supports:
||Old legacy protocol, which won’t be described here|
||Datastream protocol, as described in this document|
To mark the end of the list, the client sets the flag
0x80000000 on the last protocol in the list.
The server responds with the following data:
||flags||As described above|
||extra||Extra data, depends on the protocol, so far ignored|
Afterwards, the server expects the client to first enable TLS (if supported) and afterwards compression (if supported).
Compression is handled as Deflate applied to the socket.
This negotiation ends with the protocol advancing into the
The client reads an uint32_t of the size of the following message frame in bytes, followed by that message frame.
The client sends an uint32_t of the size of the message frame in bytes, followed by that message frame. Afterwards, if compression is enabled, the compressor is flushed.