Skip to content

What we improved over XC_VM ​

Bitstream covers the same ground as XC_VM: live channels, VOD, resellers, load balancers and an Xtream compatible client API. It is a clean rewrite, not a fork. We studied how XC_VM behaves, wrote down its weak spots, and designed around them. These are the ones that matter most to operators.

Load balancers and nodes ​

XC_VMBitstream
Every load balancer gets the main MySQL and Redis passwords, and ports 3306 and 6379 are open to the fleet. One compromised server exposes the whole panel.Nodes have no database access. They talk to the control over mutual TLS on one port.
One shared secret signs every viewer token and authorizes every server.Each node has its own secret. A token only works on the node it was signed for.
The shared secret travels in URLs between servers.Enrollment uses a single use token with the CA hash pinned. Then only mTLS.
Heartbeats write to the main database every few seconds. Offline detection takes 90 seconds.One WebSocket per node. A parent without heartbeats for 15 seconds triggers a new server tree.

Stream engine ​

XC_VMBitstream
PHP builds ffmpeg command lines as strings and tracks processes with pid files and kill -9. Custom ffmpeg text is effectively run by a shell.Go owns the processes directly (process group, clean stop). No shell. Extra flags only from an allowlist.
HLS through ffmpeg's tee muxer. Sequence numbers reset on every restart, and a dead pipe can go unnoticed.HLS built in Go from the ring buffer, continuous across restarts and source switches.
Stalls are detected by hashing the playlist every 60 seconds and "same segment for 300 seconds".Health is checked on the TS media time: a frozen or empty stream is caught in about 10 seconds.
Fixed 10 second retry and a hard stop after 3 failures. Backup sources checked every 300 seconds.Exponential backoff with jitter per source, a start limit per node, background probing and a 30 second hold before going back.
-re on every live source by default and a 5 MB, 5 second probe on every start.No -re on live sources, a small probe that grows only when audio is missing, and no nobuffer (it adds a full GOP on ffmpeg 5 and later).
LLOD cuts segments by wall clock and has no failover after start.LLOD feeds the same ring buffer and segmenter, with the same fallback.

Connections and limits ​

XC_VMBitstream
Redis records have no TTL. A restart wipes every live viewer and limits stop being enforced.Every key has a TTL or an owner. After a restart, nodes report their sessions again within 10 seconds.
Connection checks read whole sets on hot paths.One atomic Lua script per reservation.
App probes and VOD seeks can each take a connection slot.HEAD takes no slot, and the same line, IP and content reuse their slot.
Segment tokens never expire. Leaked links are replayable while the session lives.Tokens have a short deadline to open, one TS connection per session, and an IP check by prefix.

Client API ​

XC_VMBitstream
Playlist and redirect hosts come from the request Host header.URLs come only from your settings.
Every refusal on get.php, xmltv.php and stream URLs is the same 404 page.Clear status codes with an X-BS-Error code: expired, banned, restricted, connection limit and so on.
JSON field types change with the PHP version and cache path.Field names, order and types are fixed in a written contract.
xmltv.php includes every channel of the EPG source, and get_simple_data_table returns the whole history.Only the line's channels, from 24 hours ago. Built once per bouquet set and served as a file.
Channel numbers (num) restart per page or category.num is stable across the whole list.

Panel and data ​

XC_VMBitstream
Roles live on groups, unmapped pages are allowed by default.Explicit roles, deny by default, one permission check per route.
The admin API has a raw mysql_query action.No raw SQL. Every action is in the OpenAPI contract and the audit log.
Provider credentials stored in clear text.Line passwords and secrets encrypted at rest.
One settings row with about 340 columns.Typed settings groups, validated by the API.

Not there yet ​

XC_VM has some things this first version does not: RTMP, MAG and Enigma2 devices, transcoding, timeshift and catch-up, and watch folders. They are planned for a later release.

Bitstream documentation