{"slug":"gh-cf","title":"终极版！国内免梯上Github！","description":"巨简单！1分钟自建你的Github代理！","coverImage":"https://b.acofork.com/img/gh-cf-cf-gh.webp","coverWidth":1200,"coverHeight":900,"date":"2026-03-10","tags":["网络"],"pinned":false,"wordCount":133,"html":"<h2 id=\"视频\">视频</h2><p><a href=\"https://bilibili.com/video/BV16YcXzeEGJ\" target=\"_blank\" rel=\"noopener noreferrer\">https://bilibili.com/video/BV16YcXzeEGJ</a></p>\n<h2 id=\"前言\">前言</h2><p>原理这里不说，好奇的可以自行站内搜索</p>\n<h2 id=\"正式开始\">正式开始</h2><p>复制该代码</p>\n<p><a href=\"https://github.com/afoim/GithubSiteProxyForCloudflareWorker/blob/main/worker.js\" target=\"_blank\" rel=\"noopener noreferrer\">GithubSiteProxyForCloudflareWorker/worker.js at main · afoim/GithubSiteProxyForCloudflareWorker</a></p>\n<p>部署到 Cloudflare Worker</p>\n<p>创建DNS解析： </p>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\"><span class=\"hljs-operator\">*</span>.yourdomain.com CNAME CloudflareCDN</code></pre></div><p><img src=\"https://b.acofork.com/img/gh-cf-gh-cf.webp\" alt=\"\" width=\"1056\" height=\"60\" loading=\"eager\" decoding=\"async\" /></p>\n<p>创建Worker路由：</p>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\"><span class=\"hljs-operator\">*</span><span class=\"hljs-operator\">-</span>gh.yourdomain.com</code></pre></div><p><img src=\"https://b.acofork.com/img/gh-cf-gh-cf-1.webp\" alt=\"\" width=\"727\" height=\"411\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>创建重定向： </p>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">gh.yourdomain.com <span class=\"hljs-number\">302</span> github<span class=\"hljs-operator\">-</span>com<span class=\"hljs-operator\">-</span>gh.yourdomain.com </code></pre></div><p><img src=\"https://b.acofork.com/img/gh-cf-gh-cf-2.webp\" alt=\"\" width=\"807\" height=\"1076\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>屏蔽海外（海外你连不上Github？）</p>\n<p><img src=\"https://b.acofork.com/img/gh-cf-gh-cf-3.webp\" alt=\"\" width=\"2514\" height=\"1191\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>享受它！访问：</p>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">gh.yourdomain.com<span class=\"hljs-operator\">/</span>yourname</code></pre></div><p><img src=\"https://b.acofork.com/img/gh-cf-gh-cf-4.webp\" alt=\"\" width=\"2559\" height=\"1368\" loading=\"lazy\" decoding=\"async\" /></p>\n","toc":[{"id":"视频","text":"视频","depth":2},{"id":"前言","text":"前言","depth":2},{"id":"正式开始","text":"正式开始","depth":2}]}