Live streams

Run your own relay

An organization runs the relay on its own server or network, and its members’ streams go through it instead of Kymoscope.

The relay is the program that passes live streams from senders to viewers. An organization can run it on its own server, or on a PC on its network, so the members’ streams never pass through Kymoscope’s infrastructure. Streams stay end-to-end encrypted either way, and senders need no changes. Own relays belong to an organization, never to a person on their own, and are part of Enterprise, and of Embed licences with Infrastructure.

Set it up in five minutes

You need a machine with Docker that the members’ senders and browsers can reach: a server, a VM or a PC on your network.

  1. As the organization’s owner or an admin, open the organization in Kymoscope, go to the Relays tab and click Add relay. Give it a name and leave the address empty.
  2. Kymoscope shows a one-line command with the relay’s token. Copy it now: the token is shown only once.
  3. Run the command on the machine:
    Shell
    docker run -d --name kymoscope-relay --restart unless-stopped \
      -e KYMOSCOPE_RELAY_TOKEN=kr_… \
      -v kymoscope-relay:/data -p 443:8443 \
      ghcr.io/javijur/kymoscope-relay
    On its first start the relay gets an address of its own (<id>.relay.kymoscope.com, pointing at its IP, even a LAN one) and a trusted certificate for it. It needs internet that first time; it renews the certificate by itself.
  4. Back in the Relays tab the relay shows Online within a minute. Click Use for members’ streams.
  5. The members’ senders pick it up the next time they start: the Python library, the collector and the plugins need no change.

Your own address and certificate

To use a name of your own, type it as the address when you add the relay (wss://relay.customer.local) and give the relay its certificate. Browsers on app.kymoscope.com only connect over wss:// with a certificate they trust: a public one for your domain, or one from your organization’s CA installed on your computers.

Shell
docker run -d --name kymoscope-relay --restart unless-stopped \
  -e KYMOSCOPE_RELAY_TOKEN=kr_… \
  -v kymoscope-relay:/data \
  -v /etc/kymoscope/certs:/certs:ro \
  -e TLS_CERT_FILE=/certs/fullchain.pem -e TLS_KEY_FILE=/certs/privkey.pem \
  -p 443:8443 ghcr.io/javijur/kymoscope-relay

You can also run the relay without a certificate behind your own TLS proxy: it then listens on plain ws://.

Add the relay with the proxy’s wss:// address. Senders refuse a relay added with a plain ws:// address, because its ticket would travel unencrypted. On a network you trust, set KYMOSCOPE_ALLOW_INSECURE_RELAY=1 on the sending machine to allow it.

Settings

VariableWhat it does
KYMOSCOPE_RELAY_TOKENThe token from the Relays tab. It pairs the relay with the organization.
PUBLIC_ADDRESSThe IP the automatic address points at. Default: the machine’s first network address.
TLS_CERT_FILEWith TLS_KEY_FILE: the PEM certificate and key for your own address.
PORTDefault 443 with a certificate, 8080 without.
RELAY_MAX_VIEWERSViewers per stream. Default 500.
RELAY_MAX_MESSAGE_MBLargest message. Default 16.
RELAY_MAX_MB_PER_SECPer sender. Default: unlimited.

Running it

  • The relay checks every connection itself with Kymoscope’s public key: it holds no secret of ours and makes no call per viewer. It reports in once a minute while it has internet, and keeps working without it.
  • The Relays tab shows each relay’s state, version, streams and viewers. GET /v1/health on the relay answers the same.
  • A viewer that falls behind is disconnected and rejoins at the live edge.
  • New token replaces the token: restart the relay with the new command. Stop using sends the streams back through Kymoscope.
  • Browsers still need internet to sign in to Kymoscope, and senders to register their streams; the data itself only travels between them and your relay.

If it doesn’t connect

What you seeWhat to do
The automatic address doesn’t resolve on your networkSome routers refuse DNS answers that point a public name at a private IP (DNS rebinding protection). Allow relay.kymoscope.com in the router, or give the relay your own address.
“Kymoscope refused this relay token” in the relay’s logThe token was replaced or the relay deleted. Click New token in the Relays tab and restart the relay with the new command.
own_relay_not_in_planThe organization’s plan no longer includes own relays. An owner or admin clicks Stop using to publish through Kymoscope again, or contacts us.