Edge

How the cluster processes at the edge

Edge is not an app — it is how the StreamHub cluster processes. Any edge-capable app can run co-located on the master or distributed, per-stream, across edge nodes. An edge node is just a box — GPU or CPU — that dials OUT to your master over a single WebSocket, with no public endpoint and no inbound ports, NAT-friendly by design. The master schedules the work; each node pulls its assigned streams over HTTPS, runs the app worker and sends detections back as signed events.

  • Dials out — NAT-friendly
  • GPU or CPU nodes
  • Per-stream assignment
  • Signed events + MQTT
How it works

The edge connects to you

The master holds one outbound WebSocket per edge node. That single connection carries everything both ways — so an edge node behind NAT, on a home LAN or in a cloud region needs no public address and no open inbound port.

Master

StreamHub core

Ingests your cameras to HLS, manages tags and polygon zones, schedules assignments across nodes and runs the watchdog + notifier fan-out.

Assignments · commands · config
Telemetry · detections · logs

Edge node

GPU or CPU

Dials out over wss, receives its assignments, pulls each stream over HTTPS, runs the vision models and posts detections back.

01

Edge dials out

On install the node opens one WebSocket to the master (cluster-token auth) and registers itself. No inbound port, no public endpoint — it works from behind any NAT.

02

Master assigns work

The scheduler hands each (stream × model) to a node by round-robin or weighted policy, guarded by GPU memory capacity, with failover and failback.

03

Edge runs the models

The node pulls the stream over HTTPS and runs the assigned vision model against your polygon zones and per-stream settings.

04

Detections flow back

Every detection returns to the master as a signed webhook, an MQTT message and a rotated per-app log line — with the stream tags attached.

No edge box yet? The exact same runtime runs co-located on the master, so a single-node install analyses its own streams with nothing else to deploy.

Apps on the edge

Edge runs your marketplace apps

Edge is not one app — it is how the cluster runs the marketplace apps that opt in. Any edge-capable app can be assigned per stream to a node: the node pulls that stream over HTTPS, runs the app’s own worker with that stream’s config and tags, and posts detections back over the same channel. The four vision apps lead; every other edge-capable app follows the identical path.

Assigned per stream

A node does not run “an app” — it runs specific streams of an app. The scheduler places one worker per (app × stream), balanced round-robin or weighted, honours each node’s GPU/VRAM capacity, and fails work over to a healthy node if one drops. Change a zone or line and the master re-pushes the resolved config to whichever node holds that stream.

Detections emitted

Declared event names on the vision app — every payload carries the app, room, node, model, tags and timestamp.

Why edge nodes

Compute where it makes sense

Add capacity by adding boxes. Each node is disposable, schedulable and watched — and it never needs to be reachable from the internet.

NAT-friendly by design

The edge holds one outbound WebSocket to the master. No inbound port, no public endpoint, no VPN — it runs from a home LAN, a store back office or a cloud region all the same.

GPU or CPU nodes

Run a node on a GPU box for heavy multi-stream vision, or on plain CPU for lighter loads. The scheduler respects each node’s capabilities and VRAM capacity.

Round-robin or weighted

Balance assignments evenly, or give bigger nodes a larger share with a per-node weight. Rebalances on spread and reassigns on failure, with a graceful failback.

Watchdog + notifications

A cluster watchdog fires node.online / node.offline the moment a socket drops, fanned out to callback, MQTT, email, Discord and Telegram — with restart and reboot from the master.

Tags + polygon zones

Tag streams and rooms, then draw multi-polygon zones and counting lines over the live player. Settings resolve model defaults → tag config → per-stream overrides.

Detections your way

Every detection leaves as an HMAC-signed webhook, an MQTT message and a rotated per-app log line — plus each app’s own SQLite history you can query per app.

Quickstart

Add an edge node in one command

Point a fresh box at your master with a cluster token. The installer joins the cluster, installs the edge runtime and starts dialing out — no ports to open on the node.

Join the cluster as an edge node
$ curl -fsSL https://www.streamhub.studio/install.sh | sudo bash -s -- \ --join --node-type edge --cluster-token <token> --origin-ip <ip>
  • Outbound only — nothing to expose on the edge
  • GPU auto-detected; falls back to CPU
  • Idempotent: re-run to upgrade, secrets preserved
  • Same runtime co-located on a single-node install

Have cameras to put to work?

Tell us what you need to see — occupancy, counting, crowds, demographics — and we will scope the nodes, wire the events into your systems and run it with you. The software is open source; the deployment and operation is what we do.