使用Cloudflare Worker自建GitHub Proxy代理 解决raw.githubusercontents.com command not found问题

最近在hax woiden上访问带S的raw.githubusercontents.com脚本会报错command not found

现象如下:

/dev/fd/63: line 1: $'\347\275\221\347\253\231\347\273\264\346\212\244\343\200\202': command not found

/dev/fd/63: line 1: 网站维护。: command not found

查了一下,这个服务并不是GitHub官方的,目前暂停了。

消息源:https://github.com/7ednet/yard/discussions/11

所以我们需要搭一个自己的GitHub代理。


参考:

https://github.com/hunshcn/gh-proxy 的 cf worker版本

具体步骤如下:

1. 创建并登录 Cloudflare 账户

略. https://www.cloudflare.com/

2. 新建Worker

3. 修改worker内的脚本

左边这个框里的脚本删掉,换成GitHub代理用的。

打开 https://github.com/hunshcn/gh-proxy/blob/master/index.js 把内容都复制粘贴到 worker 的框里去。

这个按钮可以帮你复制文件全部内容。

4. 部署


5. 如何使用

这里是你的worker的URL

直接在你的worker的URL后面加上你要访问的github文件的URL

如:

https://github.ciys.workers.dev/https://raw.githubusercontent.com/crazypeace/warp.sh/main/warp.sh

放在你的 bash url 复合命令中就是

bash <(curl -L https://github.ciys.workers.dev/https://raw.githubusercontent.com/crazypeace/warp.sh/main/warp.sh)


评论

The Hot3 in Last 30 Days

无服务器 自建短链服务 Url-Shorten-Worker 完整的部署教程

ClouDNS .asia免费域名 托管到CloudFlare开CDN白嫖Websocket WS通道翻墙 / desec.io