Server Dispatch

Build CI Changelog

This allows engine drivers to register new servers for devices that might connect to engine vs engine connecting to devices.

ENV Vars

Usage

There are two websocket endpoints one for TCP and one for UDP

The query string should include the

WS /api/dispatch/v1/tcp_dispatch?bearer_token=testing&port=6001&accept=127.0.0.1

The websocket only communicates over BINARY frames and has the following message types:

The message structure sent down the websocket looks like:

uint8 message_type (OPENED, CLOSED etc)
string ip_address (remote IP, with null character termination)
uint64 id_or_port (client id for TCP, remote port for UDP)
uint32 data_size (number of bytes of data included)
bytes data (any data associated with the message, RECEIVED and WRITE messages only)

Statistics

Statistics are available via a GET request


{
  # Engine drivers requesting a UDP server be open
  "udp_listeners": {"162": 8},

  # Engine drivers requesting a TCP server be open
  "tcp_listeners": {"6001": 1},

  # Remote clients connected to the live servers
  "tcp_clients": {"6001": 1}
}

Deployment

When deployed in the cloud, one can configure K8s load balancer to forward data coming in on required ports to Dispatch.

Contributing

See CONTRIBUTING.md.