如何设置自定义gh-proxy参数使用我的warp脚本

能正常访问GitHub时,我推荐直接使用p3TERX的warp脚本。

hax woiden要装ipv4出站,直接执行

bash <(curl -fsSL git.io/warp.sh) 4

只有在某些hax woiden环境下访问GitHub资源不成功的情况下,需要用到我的warp脚本

https://github.com/crazypeace/warp.sh

以前一直是使用 raw.githubusercontents.com 来解决hax woiden 不能直接访问GitHub的问题,结果今天报错 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

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

- update -
raw.githubusercontents.com服务 目前已恢复。

我找到了这个服务的源头, 用它的方法自己搭了一个 cloudflare worker的gh-proxy https://github.crazypeace.workers.dev/

于是就可以在你要访问的GitHub资源前面加上这个 gh-proxy 来访问。

但是我的warp脚本里面还要访问别的GitHub资源,而免费的cloudflare worker有每天100000的请求次数限制,所以我虽然在我的脚本里写了一个默认的gh-proxy,但是我还是让脚本支持传入ghproxy参数,这样万一我的gh-proxy的免费次数用完了,你还可以自己搭建一个gh-proxy并继续使用我的脚本。


我的warp脚本使用方法:(打开TUN等操作略,这里只讲如何执行脚本)

1. Hax

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

bash <(curl -L https://你的gh-proxy/https://raw.githubusercontents.com/crazypeace/warp.sh/main/warp.sh) ghproxy https://你的gh-proxy/ 4

2. Woiden

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

bash <(curl -L https://你的gh-proxy/https://raw.githubusercontents.com/crazypeace/warp.sh/main/warp.sh) ghproxy https://你的gh-proxy/ 4 && bash <(curl -L https://你的gh-proxy/https://raw.githubusercontent.com/crazypeace/warp.sh/main/wgcf_postup_postdown.sh)


---udate

如果这个脚本不是你的作者,或者你不想fork之后自行修改,那么可以参考此篇教程用perl的正则表达式功能修改获取到的脚本内容:

https://zelikk.blogspot.com/2023/03/sed-perl-no-greedily.html


评论

The Hot3 in Last 30 Days

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

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