This application serves as a proxy for HLS streams, Images and enabling secure access to media content.
- Enter valid Cloudflare API key and Account ID.
- Enable github workflows
- Run
deployworkflow in your forked repo actionshttps://github.com/[User-Name]/[Repo-Name]/actions/workflows/deploy.yml.
Tip
Dont' forget to run the workflow
- Setup wrangler on your system.
- Download the source code.
- Run
npm install - Run
npm run devorwrangler devin your terminal to start a development server - Open a browser tab at http://localhost:8787/ to see your worker in action
- Run
wrangler deployto publish your worker
/proxy- for HLS/cors- for Images/Web pages/image- for Images/Web pages/thumbnail- for thumbnail images
Use the following format to access the proxy:
/proxy?url=<encoded_m3u8_url>&headers=<encoded_headers>
url: Base64-encoded M3U8 URL.headers: (Optional) Base64-encoded JSON string for custom headers.
btoa('https://example.com/stream.m3u8');or you can do this.
encodeURIComponent('https://example.com/stream.m3u8');btoa(JSON.stringify({ Referer: 'https://kiwik.si' }));or you can do this.
encodeURIComponent(JSON.stringify({ Referer: 'https://kiwik.si' }));Just add ref to the url
&ref=example.comHianime video streams fail to load when accessed through Cloudflare Workers proxy instead use Vercel instance.
Cloudflare Workers ignore custom HTTPS ports (e.g., :2228) in fetch() requests after deployment.
| Environment | Status |
|---|---|
Development (wrangler dev) |
✅ Works |
Production (wrangler deploy) |
❌ Fails |
This is a documented limitation of Cloudflare Workers:
Fetch requests ignore non-standard HTTPS ports
Affected Scenarios:
- All
fetch()requests to non-standard HTTPS ports (e.g.,:2228,:8443) - Any Worker making requests to custom HTTPS ports