Set Up GitHub Proxy with Cloudflare Worker
Lately, on hax woiden, running a script from raw.githubusercontents.com (the one with the S) errors out with "command not found"
The symptom is as follows:
/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
I looked into it: this service is not an official GitHub one, and it is currently suspended.
Source of the information:https://github.com/7ednet/yard/discussions/11
So we need to set up our own GitHub proxy.
Reference:
https://github.com/hunshcn/gh-proxy (the Cloudflare Worker version)
Here are the exact steps:
1. Create and log in to a Cloudflare account
Omitted. https://www.cloudflare.com/
2. Create a new Worker
3. Change the script inside the worker
Delete the script in the box on the left and replace it with the one for the GitHub proxy.
Open https://github.com/hunshcn/gh-proxy/blob/master/index.js and copy and paste the whole content into the worker's box.
This button lets you copy the entire content of the file.
4. Deploy
5. How to use it
This is your worker's URL
Simply append the URL of the GitHub file you want to fetch to the end of your worker's URL
For example:
https://ghproxy.crazypeace.workers.dev/https://raw.githubusercontent.com/crazypeace/warp.sh/main/warp.sh
Used in a compound bash/wget command it looks like this
bash <(curl -L https://ghproxy.crazypeace.workers.dev/https://raw.githubusercontent.com/crazypeace/warp.sh/main/warp.sh)







