Skip to content

Support for a binary Websocket protocol #7

Description

@jmcphers

Kallichore's Websocket protocol is modeled after that of the Jupyter kernel gateway; that is, it sends text messages over the websocket that are well-formed JSON.

{
    "channel": "iopub",
    "header": {
        "msg_type": "example"
    },
    "content": {
        "example": true
    }
}

This text-based representation has a few upsides:

  • it makes debugging a lot easier since you can examine the message and its contents as simple strings
  • it makes it easier to compose valid socket messages using high-level tools and in test frameworks

However, it also has a few downsides:

  • it is not very space efficient
  • it is unfriendly to raw binary data such as the message buffers (which we are currently base64 encoding)
  • it is slightly more computationally expensive since everything needs to be serialized on the backend and then parsed on the front end

For these reasons, the official Jupyter Server uses a binary-based WebSocket protocol. We could support exactly the same one, as an option, if needed:

https://jupyter-server.readthedocs.io/en/latest/developers/websocket-protocols.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions