Skip to content

makhembu/hls-proxy

Repository files navigation

HLS Proxy — Serverless HLS Stream Proxy

A serverless HTTP Live Streaming proxy that bypasses bot detection, referrer checks, and geo-restrictions on streaming CDNs. Accepts a target HLS URL, rewrites manifests to proxy all sub-resources through itself, and serves segments with aggressive caching. Deployable on Vercel, Netlify, or local Express.

Quick Start

git clone https://github.com/makhembu/hls-proxy
cd hls-proxy
npm install
npm start
# http://localhost:3001/?url=https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8

API

GET /?url={encoded_url}
GET /?url={encoded_url}&headers={json}
Parameter Description
url URL-encoded HLS manifest URL
headers Optional JSON with referer and origin overrides

The proxy rewrites the .m3u8 manifest so all segments, key files, and sub-playlists route through the proxy. Video segments are served with Cache-Control: public, max-age=31536000, immutable.

Architecture

Client -> Vercel/Netlify/Local -> Upstream CDN
  .m3u8   rewritten with proxy URLs
  .ts     proxied + cached (1 year)
  .vtt/.srt proxied + cached

Features

  • User-Agent rotation — randomly selects from 5 browser UAs per request to avoid fingerprinting
  • Flixier detection — auto-detects b-cdn.net, hexa, flixer, vodvidl.site URLs and sets Referer: https://vidlink.pro/
  • HLS manifest rewriting — parses .m3u8 and rewrites all URI= and segment URLs through the proxy
  • Subtitle support — detects .vtt/.srt and proxies with caching
  • Range request passthrough — supports Range headers for seek operations
  • Streaming responses — uses ReadableStream for memory-efficient large segment proxying
  • Multi-platform — identical behavior on Vercel, Netlify, or local Express

Deployment

Vercel

vercel deploy

Netlify

netlify deploy

Local

npm start   # Port 3001

About

HLS proxy for Vercel/Netlify with anti-fingerprinting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors