bridge agent
Many POS estates keep the tills off the internet on purpose. The bridge agent lets those devices onto PosKit anyway: one machine at the site that does have internet access — typically the back-office or server machine — is designated as a bridge, and the offline terminals (spokes) route all their PosKit traffic through it.
Available from the next agent release.
how it works
The bridge is a transparent HTTP CONNECT tunnel, not a middlebox:
- All traffic stays TLS-encrypted end-to-end between each spoke and the PosKit platform. The bridge cannot read or modify it.
- The bridge holds no credentials or keys for the spokes, and command signature verification is unchanged.
- Everything goes through it: device registration, the persistent relay websocket (heartbeats, commands, screenshots, logs), signing-key refresh, agent self-update, and file transfers to presigned storage URLs.
A spoke behind a bridge is a full PosKit device — there is no reduced feature set.
setting up the bridge
Pick the machine with internet access. Two ways to make it a bridge:
At install time:
poskit-agent install --token <TOKEN> --bridge
Remotely, on an already-installed agent: push a device configuration update with bridgeEnabled: true. It takes effect immediately — no restart, no site visit. Set it back to false to demote; spokes fail over to another bridge or a direct connection automatically. See agent configuration.
the bridge port
The bridge listens on port 8127 — TCP for the proxy, UDP for discovery. The port is not configurable.
| Platform | Firewall handling |
|---|---|
| Windows | Automatic — the agent manages a "PosKit Bridge" firewall rule on enable, disable and uninstall |
| Linux | Manual — you must open TCP and UDP 8127 yourself (e.g. ufw allow 8127, or your firewalld equivalent) |
A Linux bridge with 8127 closed looks healthy itself but no spoke will ever find it. If you enable bridge mode on a Linux machine, opening TCP+UDP 8127 is part of the job.
The bridge port should only be reachable on the LAN. There is no proxy authentication in this release — do not expose 8127 beyond the site network.
setting up spokes
zero-config default
Usually you do nothing. At startup (and at install time) the agent tries a direct platform connection first, with a 3-second check. Only if that fails does it broadcast on the LAN (UDP 8127) to discover a bridge, and it uses the first one that answers.
It re-probes on each service start and whenever its connection has been down for over a minute, so replacing or moving the bridge is handled automatically. Nothing is cached across restarts.
Only agents explicitly enabled as bridges answer discovery — agents never volunteer themselves.
explicit configuration
An explicit proxy always wins over auto-discovery. Three equivalent ways to set one:
| Where | How |
|---|---|
| Install command | poskit-agent install --token <TOKEN> --proxy http://<bridge-ip>:8127 |
config.json | "proxyUrl": "http://<bridge-ip>:8127" |
| Environment | POSKIT_PROXY_URL=http://<bridge-ip>:8127 |
Use explicit configuration when discovery cannot work — most commonly when the spokes and the bridge are on different VLANs, since discovery needs a shared broadcast domain.
install order matters
Spoke registration goes through the bridge, so the bridge must be installed and running before you install any spokes. A spoke installed on an offline terminal with no bridge available has nowhere to register.
worked example: one back-office server, N offline tills
A typical site: a back-office server with internet access, and six tills on the same LAN with no internet route.
-
On the back-office server, run the normal install command with
--bridgeadded:poskit-agent install --token <TOKEN> --bridgeOn Windows the firewall rule is created for you; on Linux, open TCP+UDP 8127.
-
Confirm the server appears online on the devices list.
-
On each till, run the standard install command — no extra flags:
poskit-agent install --token <TOKEN>The till fails its 3-second direct check, discovers the bridge over the LAN, registers through it, and comes online.
If the site already had an agent on the back-office server, skip step 1 and instead push bridgeEnabled: true to it from the portal — the whole rollout then needs no work on the server at all.
security
The bridge only accepts CONNECT to port 443 on an allowlist of destinations:
poskit.app, *.poskit.app, *.amazonaws.com, *.cloudfront.net
The defaults cover the platform and the domains its presigned file-transfer URLs are issued on. They can be overridden with the bridgeAllowedHosts array in config.json, which supports exact hosts and *. wildcards. A wildcard requires a subdomain — *.amazonaws.com does not match amazonaws.com itself.
To recap the properties that matter for a security review:
- End-to-end TLS between spoke and platform; the bridge cannot inspect or alter traffic.
- No credentials or keys on the bridge; command signing verified by the spoke as normal.
- Destination allowlist, port 443 only.
- Only explicitly-enabled bridges answer discovery.
- No proxy authentication in this release — keep 8127 LAN-only.
behaviour and limitations
| Situation | Behaviour |
|---|---|
| Bridge goes offline | Spokes retry with backoff (1s–60s) and show as offline until it returns. They do not restart or lose state |
| Multiple bridges on one LAN | Supported — spokes use whichever answers discovery first |
| Spokes on a different VLAN | Discovery will not reach them; use the explicit --proxy setting |
Bridge demoted (false) | Spokes fail over to another bridge, or direct connection if they have one |
While the bridge is down its spokes are subject to everything on what an offline device cannot do — the platform cannot tell "till is off" from "bridge is down", so a whole site of spokes going offline at once is a strong hint the bridge is the problem.
troubleshooting
A spoke does not discover the bridge:
- Confirm the bridge and spoke are on the same LAN segment/VLAN — discovery is a broadcast and does not cross VLANs. If they are separated by design, use
--proxy. - Check UDP 8127 is open on the bridge — on Linux this is manual; on Windows check the "PosKit Bridge" rule was not removed by policy.
- Confirm the bridge agent actually has bridge mode enabled — a plain agent never answers discovery.
Spokes are online but file transfers or updates fail:
- If
bridgeAllowedHostshas been overridden in the bridge'sconfig.json, the override replaces the defaults. A custom list missing*.amazonaws.com/*.cloudfront.netbreaks file transfers and self-update while everything else works. Restore the missing entries or remove the override.
The whole site is offline:
- Check the bridge machine first — spokes reconnect on their own once it is back.