A fast, no-caching proxy server for .m3u8 HLS playlists and segments, built using Rust and Actix-Web.
It rewrites .m3u8 files so that all segment requests (like .ts, .vtt, etc.) go through the same proxy — enabling CORS and header manipulation.
- Streams
.m3u8,.ts,.vtt, etc. - Supports custom headers via
&headers=... - Supports custom
Originvia&origin=... - Handles CORS automatically
- Fast: uses keep-alive connection pooling
git clone https://github.com/zuhaz/rust-proxy.git
cd rust-proxycurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shcargo runThe server will start at:
http://127.0.0.1:8080
To change the port or allowed origins, edit main.rs.
Pull the latest image:
docker pull ghcr.io/zuhaz/rustproxy:latestRun it:
docker run -p 8080:8080 ghcr.io/zuhaz/rustproxy:latestGET /?url=https://example.com/file.ts
GET /?url=https://example.com/playlist.m3u8
GET /?url=https://example.com/playlist.m3u8&headers={"Referer":"https://example.com"}
GET /?url=https://example.com/playlist.m3u8&origin=https://example.com
The server will automatically load environment settings from the included .env file. No additional setup is required.
Edit ENABLE_CORS in the .env file:
ENABLE_CORS=trueOr disable it:
ENABLE_CORS=falseYou need to update the following section in main.rs:
static ALLOWED_ORIGINS: Lazy<[&str; N]> = Lazy::new(|| [
"http://localhost:5173",
"http://localhost:3000",
"http://your-new-origin.com", // <-- add here
]);Both changes are required for proper CORS behavior when ENABLE_CORS=true.
Using: Apache License 2.0
Inspired by: https://github.com/Gratenes/m3u8CloudflareWorkerProxy