Proxy
The proxy#
The proxy is a small stateless service that fetches a URL on the server's behalf and hands the response back with permissive CORS headers, so your browser can play a stream from a CDN that would otherwise refuse it.
It stores nothing, needs no database, and runs with an empty config file.
Do I need one?#
Only if you want your own. P-Stream ships with a shared one, and the extension replaces it entirely — if you use the extension, a proxy adds nothing.
The two reasons to run your own:
- iOS. Extensions aren't available, so a proxy is the only way to get off the shared default.
- A shared IP is a rate-limited IP. Streaming sites throttle by address. Your own instance is used by you alone.
Host it somewhere with a residential or plain VPS address. Cloudflare Workers, Netlify and the big serverless platforms have been abused enough that most streaming sites now block their whole IP ranges — the proxy will build and deploy fine there and then fail to fetch anything.
What it exposes#
| Route | What it does |
|---|---|
/ | Fetches ?destination=<url> and returns it with CORS headers |
/stream | Same, but rewrites HLS playlists so segments come back through it |
/fragment | Segments, keys and init segments for a rewritten playlist |
/cache | Short-lived cache of already-resolved stream URLs |
/quality | Shared "max quality seen" map, so the source picker can badge one |
/health | { status, uptime }. ?bytes=N returns N bytes to measure throughput |
Next: deploy it.