🚀 GitHub 加速代理服务

基于 Cloudflare Worker + ghproxy 的透明加速方案

✓ 服务运行正常 | 当前节点: gh.ringin.icu

📋 功能特性

自动代理所有 GitHub 相关域名请求
支持 Git Clone、下载 Release、访问 Raw 文件
利用 ghproxy 镜像加速,多节点自动切换
Cloudflare 全球 CDN 加速
对客户端完全透明,无需修改代码

🔧 配置步骤

步骤 1: 部署 Cloudflare Worker

将本代码部署到 Cloudflare Worker,并绑定自定义域名(如 gh.yourdomain.com

步骤 2: 配置 ADGuard Home DNS 重写

在 ADGuard Home 的 过滤器 → DNS 重写 中添加规则:

github.com                    gh.yourdomain.com
*.github.com                  gh.yourdomain.com
raw.githubusercontent.com     gh.yourdomain.com
*.githubusercontent.com       gh.yourdomain.com
codeload.github.com          gh.yourdomain.com
objects.githubusercontent.com gh.yourdomain.com
步骤 3: 测试配置

在局域网内的设备上测试:

git clone https://github.com/username/repo.git
# 或者直接访问 GitHub 网站

📦 支持的服务

分支源码下载:
https://github.com/user/repo/archive/refs/heads/main.zip
Raw 文件:
https://github.com/user/repo/blob/main/install.sh
https://raw.githubusercontent.com/user/repo/refs/heads/main/install.sh
Release 文件:
https://github.com/user/repo/releases/download/v1.1.8/file.tar.gz
Release 源码:
https://github.com/user/repo/archive/refs/tags/v1.1.8.zip
Gist 文件:
https://gist.githubusercontent.com/user/id/raw/file.txt
Git Clone:
git clone https://github.com/user/repo.git
API 访问:
https://api.github.com/repos/user/repo

⚠️ 注意事项

• 必须为 Worker 绑定自定义域名,否则 HTTPS 证书会不匹配

• DNS 重写会影响局域网内所有设备

• 首次访问可能需要等待 DNS 缓存刷新

• 建议定期检查 ghproxy 服务的可用性