KRZN.live
Features

VPS edge

The VPS edge is a second KRZN Live that runs on the VPS, next to the frp server of the tunnel. Sites (satellite locations) send their feed to the edge directly, with SRT or RTMP, and the central server pulls each feed from the edge with its own SRT connection.

site (OBS, vMix, encoder) --SRT/RTMP--> VPS edge --one SRT connection per site--> central KRZN Live

Compared to the tunnel, where every feed shares a single TCP connection between the VPS and central, a packet lost on one feed doesn't delay the others, and SRT can recover losses on each link.

Install the edge

The edge is the Linux build of the same program, with the configuration in scripts/edge/edge.yml. It doesn't replace anything that already runs on the VPS: it uses its own folder (/opt/krznlive-edge), its own service (krznlive-edge), its own user, and ports that differ from the ones of the frp server:

Port Use
9890/UDP SRT, sites publish here
9935/TCP RTMP, sites publish here
9987/TCP Control API (HTTPS), used by central
  1. Build the Linux binary: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o krznlive .
  2. Copy krznlive, scripts/edge/edge.yml, scripts/edge/krznlive-edge.service and scripts/edge/install-edge.sh into a folder on the VPS.
  3. Run sudo EDGE_PASS=<a long password> sh install-edge.sh. The installer creates a self-signed certificate for the Control API and prints its fingerprint. Later updates of the binary don't need EDGE_PASS.
  4. Allow the ports above in the firewall of the VPS provider (for example, the security group on AWS).

The edge is also the hub of the cluster of central computers (clusterHub: yes): it keeps the lease that says which central computer is the main one.

The service is limited to 300 MB of memory, so that it can't disturb other services on a small VPS. Logs are read with journalctl -u krznlive-edge.

Connect central

In the Settings page of the dashboard (VPS edge), or in the configuration file:

edge: true
edgeAddress: 203.0.113.10
edgePass: the-password-given-to-the-installer
edgeFingerprint: the-fingerprint-printed-by-the-installer

Then, in Stream Paths, use Receive through the VPS edge on the paths of the sites. Their stream keys, when they have one, are copied to the edge automatically. A key is optional: the edge accepts only the paths copied by central, so without a key the path name identifies the site (anyone who knows the name can publish to it). The the publish fields shown for the path point to the edge. The path is pulled from the edge (edge: true in the path configuration); when edge is disabled globally, encoders publish to central as usual.

The VPS tunnel page shows the state of the edge and of every site connected to it. For sites that send with SRT, the round trip and the packet loss shown in Feed health are the ones of the link between the site and the edge (marked via edge), and the SRT latency to use is computed from them.

Paths and keys are kept by central: when the edge restarts, central copies them again within a few seconds. Recording is disabled on the edge, since a small VPS doesn't have the disk space for it: feeds can be recorded at central.

Message us