A lightweight HLS reverse proxy IPTV.
973
HLS Public Proxy is a lightweight Node.js proxy for HLS manifests and media segments.
It can:
.m3u8, .m3u, and related playlist URLsurl=u=preferred_refererknown_origins for referer handlingGET /Landing page with built-in docs and a live URL builder/test UI.
GET /healthReturns runtime status and cache counters.
GET /proxy/manifestFetches an upstream manifest, validates it, rewrites child URLs, and returns the rewritten playlist.
GET /proxy/segmentFetches and streams media segments or related assets.
url=Standard URL-encoded upstream URL.
u=Base64-encoded upstream URL.
preferred_referer=Overrides the referer sent upstream.
known_origins=One or more trusted origins used for referer handling.
This example uses Base64 mode:
<URL>/proxy/manifest?u=aHR0cHM6Ly8yLmNkbjJlbWJlZC5zaXRlL2NhemV0di9pbmRleC5tM3U4&preferred_referer=https%3A%2F%2F3.embedcanaisonline.com%2F&known_origins=https%3A%2F%2F2.cdn2embed.site
Decoded target URL:
https://2.cdn2embed.site/cazetv/index.m3u8
Useful for long URLs or when combining extra query parameters.
Useful when you want the upstream URL to remain directly readable in the query string.
/proxy/manifest supports both url= and u=./proxy/segment supports both url= and u=.url= should be treated as the primary input.known_origins may be repeated multiple times in the final URL.preferred_referer should be URL-encoded.u must contain the Base64 version of the raw target URL.This project is HAProxy-friendly and works well behind a reverse proxy or load balancer.
Typical use case:
Because the app can derive its public base URL from forwarded headers, it fits well behind HAProxy in front of one or more containers.
Build locally:
docker build -t hls-public-proxy .
docker run --rm -p 3000:3000 hls-public-proxy
Then open:
http://localhost:3000/
Docker Compose example:
services:
hls-public-proxy:
image: jeffersoncgo/hls-public-proxy:latest
container_name: hls-public-proxy
restart: unless-stopped
ports:
- "3000:3000"
environment:
PORT: 3000 # Listen port inside the container
HOST: 0.0.0.0 # Listen on all interfaces
MAX_PARALLEL: 64 # OPTIONAL: Maximum number of parallel fetches for manifest and segments (default 64)
# DEFAULT_REFERER: https://example.com/ # OPTIONAL: Set a default referer header for all requests
# PROXY_BASE: https://proxy.example.com # OPTIONAL: Base URL for the proxy, used in generated manifest URLs
# FLARESOLVERR: http://flaresolverr:8191 # OPTIONAL: URL of a FlareSolverr instance for bypassing anti-bot protections
# SEGMENT_CACHE_MAX: 500 # OPTIONAL: Maximum number of segments to cache in memory
# SEGMENT_CACHE_TTL_MS: 90000 # OPTIONAL: Time-to-live for cached segments in milliseconds
# MANIFEST_CACHE_MAX: 200 # OPTIONAL: Maximum number of manifests to cache in memory
# MANIFEST_CACHE_TTL_MS: 4000 # OPTIONAL: Time-to-live for cached manifests in milliseconds
# SEGMENT_CACHE_MAX_BYTES: 2000000 # OPTIONAL: Maximum size in bytes for cached segments (default 2MB)
The landing page includes:
Content type
Image
Digest
sha256:9aa729e55…
Size
60.7 MB
Last updated
5 months ago
docker pull jeffersoncgo/hls-public-proxy