Decides what happens to each later client frame.
Sees each server frame before the relay forwards it unchanged, and returns the new resumption handle the frame
carries, else null. Called for every frame (avatar video included), so it should check cheaply before parsing.
The frames sent upstream before any client frame, for example the setup the server wrote.
Reads the browser's first frame. Returns what it asks for, or null when the frame does not open a session (the
relay then closes the connection). The first frame itself is never forwarded.
Headers for the upstream handshake (for example Authorization: Bearer <token>). Called on every upstream open,
so a short-lived token is fresh for each connection. Never logged and never sent to the browser.
The provider half of MJAPI's realtime relay: what the relay needs to know about one provider's wire protocol. The relay (MJServer) owns the transport (sockets, deadlines, pings, the frame cap, close codes) and calls the policy at five points. A policy lives with its provider driver, so MJServer depends on this interface only.
Client frames are text: the relay drops binary client frames before the policy sees them, and every frame a policy returns goes upstream as text. Server frames reach ObserveServerFrame as bytes and go to the browser unchanged.