简介
针对 github release、archive 以及项目文件的加速项目,支持 clone,有 Cloudflare Workers 无服务器版本以及 Python 版本
作者の演示站
演示站为公共服务,如有大规模使用需求请自行部署,演示站有点不堪重负(
GitHub 地址
https://github.com/hunshcn/gh-proxy
Changelog
-
2020.04.09 增加 Python 版本(使用 Flask)
-
2020.03.23 新增了 clone 的支持
-
2020.03.22 初始版本
python 版本和 cf worker 版本差异
- python 版本支持进行文件大小限制,超过设定返回原地址 issue #8
使用
直接在 copy 出来的 url 前加https://gh.api.99988866.xyz/
即可
也可以直接访问,在 input 输入
大量使用请自行部署,以上域名仅为演示使用。
以下都是合法输入:
-
release 源码:https://github.com/hunshcn/project/archive/v0.1.0.tar.gz
-
release 文件:https://github.com/hunshcn/project/releases/download/v0.1.0/example.zip
-
分支文件:https://github.com/hunshcn/project/blob/master/filename
-
commit 文件:https://github.com/hunshcn/project/blob/1111111111111111111111111111/filename
页面输入示例
分支源码:
https://github.com/microsoft/vscode/archive/refs/heads/main.zip
Raw文件:
https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt
Release源码:
https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zip
Release文件:
https://github.com/fatedier/frp/releases/download/v0.33.0/frp_0.33.0_linux_amd64.tar.gz
终端输入示例
git clone:
git clone https://gh.api.99988866.xyz/https://github.com/microsoft/vscode
wget:
wget https://gh.api.99988866.xyz/https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zip
curl:
curl -O https://gh.api.99988866.xyz/https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zip
cf worker 版本部署
首页:https://workers.cloudflare.com
注册,登陆,Start building
,取一个子域名,Create a Worker
。
复制 index.js 到左侧代码框,Save and deploy
。如果正常,右侧应显示首页。
index.js
默认配置下 clone 走 github.com.cnpmjs.org,项目文件会走 jsDeliver,如需走 worker,修改 Config 变量即可
Python 版本部署
Docker 部署
docker run -d --name="gh-proxy-py" \
-p 0.0.0.0:80:80 \
--restart=always \
hunsh/gh-proxy-py:latest
第一个 80 是你要暴露出去的端口
直接部署
安装依赖(请使用 python3)
pip install flask requests
按需求修改app/main.py
的前几项配置
注意
python 版本的机器如果无法正常访问 github.io 会启动报错,请自行修改静态文件 url
默认配置下 clone 走 github.com.cnpmjs.org,项目文件会走 jsDeliver,如需走服务器,修改配置即可
计费
到 overview
页面可参看使用情况。免费版每天有 10 万次免费请求,并且有每分钟 1000 次请求的限制。
如果不够用,可升级到 $5 的高级版本,每月可用 1000 万次请求(超出部分 $0.5/百万次请求)。
暂无评论内容