HOA FastDL is a lightweight GitHub proxy and accelerator service built on Cloudflare Workers. It allows you to mirror and proxy various GitHub content including releases, archives, raw files, and more.
- GitHub Content Proxy: Supports releases, source code archives, tags, blobs, raw files, and gists.
- Whitelist Security: Restrict proxying to specific organizations or repositories using the
WHITE_LISTsetting. - jsDelivr Integration: Optional rewriting of blob/raw links to jsDelivr for faster downloads.
- CORS Support: Configurable allowed origins for cross-origin requests.
Configuration is managed via environment variables in wrangler.toml:
| Variable | Description |
|---|---|
PREFIX |
Route prefix for the worker (must start and end with /). Example: /. |
WHITE_LIST |
Comma-separated substrings that must be in the target URL. |
USE_JSDELIVR |
"1" to rewrite blob/raw links to jsDelivr; "0" to proxy directly. |
ALLOWED_ORIGINS |
Comma-separated list of allowed origins for CORS. |
The worker operates by intercepting incoming requests and rewriting them to fetch content from GitHub.
- URL Extraction: It removes the worker's domain and configured
PREFIXfrom the request URL to determine the target GitHub resource. - Validation: The target URL is matched against supported patterns (releases, archives, raw files, etc.) and checked against the optional
WHITE_LIST. - Routing:
- jsDelivr: If enabled, compatible file requests (blob/raw) are redirected to
cdn.jsdelivr.netfor faster delivery. - Direct Proxy: Other requests are forwarded directly to GitHub.
blobURLs are automatically converted torawfor file downloading.
- jsDelivr: If enabled, compatible file requests (blob/raw) are redirected to
- Response Handling: The worker streams the response from GitHub back to the client, handling redirects and adding necessary CORS headers.
Assuming your worker is deployed at https://gh.example.com and PREFIX is set to /:
Original GitHub URL:
https://github.com/HITSZ-OpenAuto/hoa-fastdl/archive/refs/heads/main.zip
Proxied URL:
https://gh.example.com/github.com/HITSZ-OpenAuto/hoa-fastdl/archive/refs/heads/main.zip