🚀 GitHub Proxy

Cloudflare Pages 上的 GitHub 反向代理。把任意 GitHub 资源的 URL 拼到 /g/ 后面即可。

基本用法

https://<your-project>.pages.dev/g/github.com/<owner>/<repo>
https://<your-project>.pages.dev/g/raw.githubusercontent.com/<owner>/<repo>/<branch>/<file>
https://<your-project>.pages.dev/g/api.github.com/repos/<owner>/<repo>
为什么 path 里没有 https://
Cloudflare CDN 会把 URL 路径里的 // 当作 network-path reference 合并掉(RFC 3986 §4.2),导致 /g/https://github.com/... 永远到不了 Function —— 会被当成静态资源。我们统一在 path 里去掉 scheme,Function 里自动补 https://

Git 克隆 / Remote

git clone https://<your-project>.pages.dev/g/github.com/<owner>/<repo>.git
git remote set-url origin https://<your-project>.pages.dev/g/github.com/<owner>/<repo>.git

支持的域名