Self-host hls-restream-proxy
Lightweight HLS restream proxy for media servers
- Stars
- 255
- Port
- 8089 (HLS proxy HTTP listener)
ghcr.io/pcruz1905/hls-restream-proxyWhat is hls-restream-proxy?
hls-restream-proxy is a lightweight toolkit that sits between self-hosted media servers (Jellyfin, Emby, Plex via Threadfin/xTeVe) and upstream HLS/IPTV sources that require specific HTTP headers like User-Agent and Referer. It consists of a Python reverse proxy (hls-proxy.py) that adds headers and rewrites m3u8 playlists so segment requests also pass through it, a bash script (refresh-m3u.sh) that scrapes source pages to generate an M3U playlist with stable proxy URLs, and a detector tool (detect-headers.sh) to automatically discover which headers a stream needs. The proxy auto-learns Referer headers per upstream host and caches m3u8 URLs for an hour to handle token refresh transparently. It runs on Python 3.8+ with no pip dependencies, and can be deployed via Docker, Docker Compose, manual execution, or systemd user services. The project is MIT-licensed and aimed at homelab users running personal media servers.
Should you self-host hls-restream-proxy?
hls-restream-proxy scores 46/100 on selfhost.directory (how scoring works) and ranks #42 of 54 in Media Streaming. It has 255 GitHub stars.
There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.
Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Python.
Its closest alternative on selfhost.directory is Invidious (81/100, 25 799 stars). It scores higher overall, so compare the two before you pick. See hls-restream-proxy vs Invidious side by side.
Features
- Auto Referer learning
- Auto token refresh
- Bandwidth declaration
- Header detection tool
- HLS header injection
- IP allowlist
- M3U Playlist Generation
- Multiple extraction modes
- Playlist Rewriting
- Upstream M3U ingestion
hls-restream-proxy README
FAQ
Can I use this with VLC or mpv?
Yes. The /channel/<slug> endpoint returns a standard HLS playlist. Any player that supports HLS can play it directly.
Does this work with Plex or Emby?
Not directly — Plex and Emby don't read M3U files. You need Threadfin or xTeVe between this proxy and Plex/Emby to make M3U sources appear as a local TV tuner.
Jellyfin thinks my stream is 20 Mbps when it's really ~6 Mbps?
This happens when the upstream returns a single-variant media playlist with no BANDWIDTH tag. Fix by declaring the real bitrate as the 9th pipe-delimited field in channels.conf, or set HLS_DEFAULT_BANDWIDTH globally.
Do I still need to transcode in Jellyfin?
The proxy itself never transcodes — it only fixes headers so Jellyfin can fetch the stream. Whether Jellyfin transcodes afterwards depends on the stream and the client. Most free HLS streams are H.264 + AAC, which direct-play on virtually every client.
Does this add latency?
No. The proxy is passthrough only — it forwards the exact same bytes from the upstream, no transcoding. The only added latency is the network hop through the proxy (typically <1ms on localhost).
Why not a Jellyfin plugin?
Standalone scripts work with any media server and any player. No .NET dependency, no breakage when Jellyfin updates, and it also works with VLC, mpv, or any HLS-capable player.
More in Proxy
HysteriaSelf-hosted, open-source proxy server and client that rides a customized QUIC stack masquerading as HTTP/3, with SOCKS5, HTTP, forwarding, TProxy and TUN modes.
i6.sharkSelf-hosted IPv6 proxy generating random /48 subnet addresses per request to defeat IP rate limits. HMAC-SHA256 auth, runs as Go binary on Linux.
iodineOfficial git repo for iodine dns tunnel
iptv-proxyA self-hosted IPTV reverse proxy that rewrites M3U and Xtream Codes streams to your own address with custom login, plus HDHomeRun emulation for media servers.
LadderSelf-hosted, open-source HTTP proxy that strips CORS and paywall headers, injects code, and applies per-domain YAML rulesets; runs as a Go binary, Docker or Helm chart.
LucX-UILucX-UI is a self-hosted Xray VPN panel forked from 3x-ui adding kernel-mode AmneziaWG, tunnel sidecars, and advanced subscriptions.
marretaOpen-source, self-hosted paywall bypasser that cleans pages, strips tracking parameters and blocks domains, run via Docker Compose with an admin panel and REST API.
meridianMeridian is an open-source CLI that deploys censorship-resistant VLESS+Reality, XHTTP, and Hysteria2 proxy servers on your VPS with automatic hardening.
MirrorProxyMirrorProxy is a self-hosted, open-source mirror acceleration gateway for GitHub, Docker/OCI, language packages, and Linux/BSD repos with access control and quotas.
mtgmtg is a self-hosted, open-source MTProto proxy for Telegram designed to work in censored environments with domain fronting, traffic mimicry, and proxy chaining support.
mullgateSelf-hosted command-line tool converting a Mullvad account into multiple authenticated proxy endpoints for selective traffic routing.
naiveproxyYurich Panel is a Bash script that automates deploying a proxy service on Ubuntu VPS with Caddy, Naive transport, Xray, Hysteria 2, WARP, and Unbound DNS.
0 comments