Skip to content

Why panel proxies ​

A panel proxy (bs-edge) is a small server that sits between Cloudflare and your control. Clients, apps and the panel reach the control only through it. This page says why, and what it hides.

The layering ​

apps, players, the panel
        |
   Cloudflare (proxied record, orange cloud)
        |
   panel proxies (bs-edge, cheap and replaceable)
        |
   bs-control (its IP is never published)

Video does not take this path. A play request goes through a proxy, and the control answers with a 302 to a node. The player then talks to the node directly, as before.

What it hides ​

Cloudflare already hides the control IP from people who only know the domain. It is still easy to find:

  • an old DNS record, or a record in another zone that points to it;
  • an email header, a webhook or a certificate log;
  • a scan of the whole IPv4 space for your TLS certificate or your login page.

Once someone knows the real IP, they skip Cloudflare and attack the control head on. With panel proxies the control IP is never in DNS, never in a certificate the public sees, and, with the lockdown on, it does not answer anyone but the proxies, the nodes and the database. If a proxy IP leaks or gets attacked, you replace the proxy in a minute. The control keeps its address.

What passes through a proxy ​

PassesDoes not pass
Admin API and the panel (SPA)Live and VOD video
Client API: player_api.php, get.php, xmltv.php, EPGNode delivery ports
Play entry points that answer a 302 to a node
Node channels to the control (optional)

How trust works ​

  • A proxy joins with a one-time key, then talks to the control over mutual TLS with its own certificate. The control can burn that certificate at any time.
  • The proxy sends the client IP in a header signed with its own secret (HMAC). The control trusts that IP only from an enrolled proxy over mutual TLS. A forged X-Forwarded-For or CF-Connecting-IP from anywhere else is ignored.
  • With Only Cloudflare on (the default), a proxy answers only Cloudflare addresses and trusts CF-Connecting-IP only from them. The control keeps the Cloudflare ranges up to date and sends them to every proxy.
  • A proxy removes Server, Via and forwarding headers in both directions. It answers errors with a generic page, so nothing names the control.
  • Node channels can go through the proxies too. The proxy passes the TLS connection through and tells the control the node IP in a signed first line. The control then answers with a certificate that has no host names.

The lockdown ​

Accept only from proxies makes the control answer on its public ports only through a proxy. Three things keep you from locking yourself out:

  1. You can only turn it on from a page opened through a proxy, with at least one proxy online.
  2. It turns itself off after 5 minutes unless you confirm it, again through a proxy.
  3. If no proxy reports for 10 minutes, it turns itself off.

On the server, bs-lockdown (a systemd timer, every minute) closes the firewall to match: only the proxies, the direct nodes and the database get in. SSH is never touched. sudo /opt/bitstream/bin/bs-lockdown off opens everything at once if you ever need it.

DNS ​

With Manage the DNS record on, the panel record in Cloudflare holds one proxied A record per online proxy. When a proxy goes offline, is replaced or removed, its record leaves on the next sync (within a minute). The control IP is never written there, and the panel warns you when any record in the zone points to it.

The panel URL ​

Apps get the panel URL (or the client URL) in get.php, player_api.php, the XMLTV and EPG links and the line share links. While panel proxies are in use, the panel refuses a panel or client URL that is an IP address or that resolves to the control itself, and the Panel proxies and Domains pages warn about one set earlier. Until you fix it, apps get the panel DNS record instead, so the control IP is never published.

Sizing ​

bs-edge uses a few MB of memory and almost no CPU. The smallest VPS of any provider is enough. Two proxies in different providers are a good start.

See Add or replace a panel proxy.

Bitstream documentation