qbss_proxy module

class qbss.proxy.qbss_proxy.QBSSProxy(*args: Any, **kwargs: Any)

Bases: WebsocketHandler

QBSS Proxy class to server a websocket handler that will communicate with the locally running host stack IPC tunnel for QBSS.

The Websocket handler uses a similar API to the IPC API defined in QBSS’s _ipc_structs.h file. The only additional intricacies are:

  • All requests must come in as a JSON dict, with the ipc field being set to the desired IPC. The field’s value should be the name of the IPC, e.g. "qbss_get_dsp".

  • Status or action fields that are an enum in QBSS IPCs are used by name, and capitalized. E.g. a qbss_get_block request may return with the status being set to UNKNOWN_KEY.

  • For getting or publishing a block, instead of the block’s data being put in the JSON dict, a follow-up message after the JSON dict containing the binary data of the block is used instead. This is a binary websocket message instead of a text websocket message.

  • For the INFO_ALL action in qbss_manage_stream(), each stream’s information is sent as an individual websocket message. Use the num_streams field in the original message to know how many additional messages will be arriving.

qbss.proxy.qbss_proxy.launch(hssock)