把 https://github.com/... 里的 github.com 换成站点域名即可。服务会实时选最优上游并返回 302 重定向,流量直连镜像站(不经过本机),支持 Range 断点续传:
# 下载 release 资源(curl 加 -L 跟随重定向)
curl -L -O "https://gh.somtfly.com/github.com/owner/repo/releases/download/v1.0/x.zip"
# raw / archive / codeload / gist 同理
curl -L -O "https://gh.somtfly.com/raw.githubusercontent.com/owner/repo/main/file.txt"
# 强制走本机中转(不重定向,便于排查):加 ?proxy=1
curl -L -O "https://gh.somtfly.com/github.com/owner/repo/releases/download/v1.0/x.zip?proxy=1"
# git clone(POST 无法重定向,自动走中转)
git clone https://gh.somtfly.com/github.com/owner/repo.git
GET /fetch?u=<urlencode(github_url)>
| 类型 | 说明 / 示例 |
|---|---|
| Release 附件 | github.com/owner/repo/releases/download/…(含 releases/latest/download/…) |
| 源码包 archive | github.com/owner/repo/archive/refs/heads|tags/….zip|tar.gz |
| codeload | codeload.github.com/…(视上游而定) |
| raw 文件 | raw.githubusercontent.com/…、github.com/…/raw/… |
| gist | gist.github.com / gist.githubusercontent.com |
| git clone / fetch / pull | smart HTTP(info/refs + POST git-upload-pack) |
| git ls-remote | 查看远程分支/标签 |
| 头像 / 静态资源 | avatars.githubusercontent.com、user-images / camo(视上游而定) |
api.github.com(防开放代理滥用)。| 接口 | 说明 |
|---|---|
/api/health | 服务存活 |
/api/upstreams | 上游池 + 健康(延迟/速度/可用) |
/api/stats | 上游池统计汇总 |
/api/resolve?u=<url> | 解析可选线路列表 |
/api/best?u=<url> | 当前最优上游 |
默认直接 302 到最优上游(Location 即镜像直链);加 ?proxy=1 走本机中转时,响应会带 X-Upstream: <上游名>,便于排查走的是哪条线路。