基于 Cloudflare Worker + ghproxy 的透明加速方案
将本代码部署到 Cloudflare Worker,并绑定自定义域名(如 gh.yourdomain.com)
在 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
在局域网内的设备上测试:
git clone https://github.com/username/repo.git # 或者直接访问 GitHub 网站
https://github.com/user/repo/archive/refs/heads/main.zip
https://github.com/user/repo/blob/main/install.shhttps://raw.githubusercontent.com/user/repo/refs/heads/main/install.sh
https://github.com/user/repo/releases/download/v1.1.8/file.tar.gz
https://github.com/user/repo/archive/refs/tags/v1.1.8.zip
https://gist.githubusercontent.com/user/id/raw/file.txt
git clone https://github.com/user/repo.git
https://api.github.com/repos/user/repo
• 必须为 Worker 绑定自定义域名,否则 HTTPS 证书会不匹配
• DNS 重写会影响局域网内所有设备
• 首次访问可能需要等待 DNS 缓存刷新
• 建议定期检查 ghproxy 服务的可用性