Wire Format (AXON/1.0)
AxonKit uses a custom text-based protocol, AXON/1.0, over the DataChannel for
low-latency bidirectional signaling. It is inspired by the
NATS wire protocol.
Frame types
Section titled “Frame types”REQ <method> <logId>\r\n -- requestRES <logId> <status>\r\n -- responseMSG <method> [<logId>]\r\n -- notification (logId optional)Frame structure
Section titled “Frame structure”REQ <method> <logId>\r\n[AXON/1.0\r\n -- optional headers blockKey: Value\r\n\r\n]<body bytes> -- JSON or binary payloadREQ— a request from the client or server, carrying a method and a correlationlogId.RES— a response correlated to a request vialogId, with a status.MSG— a one-way notification;logIdis optional.
The optional headers block is delimited by the AXON/1.0 sentinel and a blank
line, followed by the message body (JSON or raw binary).
Example methods
Section titled “Example methods”The RPC surface covers publishing, subscribing, and participant control, e.g.:
- Client → Server:
publish,subscribe,mute, … - Server → Client:
subscription.create, notifications, …