Skip to content

Latest commit

 

History

History
110 lines (79 loc) · 5.36 KB

README_EN.md

File metadata and controls

110 lines (79 loc) · 5.36 KB

Cloudflare Workers Proxy

English / 简体中文

Cloudflare Workers HTTP reverse proxy

License: GPL-3.0 GitHub stars GitHub forks GitHub release

It is recommended to use regular expressions to filter requests for personal use, and set a custom domain name for the worker. It is forbidden to use the proxy for the entire site, such as GitHub. Otherwise, the official risk control will not be responsible for the account.

Theoretically, it supports proxying any blocked domain name. You only need to set the environment variable PROXY_HOSTNAME to the blocked domain name, and then access it through your worker custom domain name.

Deploy

Note: In most cases, you can use _worker.js to deploy, but some proxy addresses require special processing. Please use the specified file when deploying.

Name File
General _worker.js
Docker docker.js

Environment variables

Name Required Default Example Remark
PROXY_HOSTNAME github.com Proxy address hostname
PROXY_PROTOCOL × https https Proxy address protocol
PATHNAME_REGEX × ^/jonssonyan/ Regular expression for proxy address path
UA_WHITELIST_REGEX × (curl) Regular expression for User-Agent whitelist
UA_BLACKLIST_REGEX × (curl) Regular expression for User-Agent blacklist
IP_WHITELIST_REGEX × (192.168.0.1) Regular expression for IP whitelist
IP_BLACKLIST_REGEX × (192.168.0.1) Regular expression for IP blacklist
REGION_WHITELIST_REGEX × (JP) Regular expression for region whitelist
REGION_BLACKLIST_REGEX × (JP) Regular expression for region blacklist
URL302 × https://github.com/jonssonyan/cf-workers-proxy 302 Redirect address
DEBUG × false false Enable DEBUG

Mirror repository proxy

  1. Set the environment variable PROXY_HOSTNAME to the mirror repository address.
Mirror repository Address
docker registry-1.docker.io
k8s-gcr k8s.gcr.io
k8s registry.k8s.io
quay quay.io
gcr gcr.io
ghcr ghcr.io
cloudsmith docker.cloudsmith.io
ecr public.ecr.aws
  1. Set up a Docker registry proxy

    Replace https://dockerhub.xxx.com with your worker custom domain name

    mkdir -p /etc/docker
    cat >/etc/docker/daemon.json <<EOF
    {
      "registry-mirrors":["https://dockerhub.xxx.com"]
    }
    EOF
    systemctl daemon-reload
    systemctl restart docker
  2. Search Mirror

    docker search dockerhub.xxx.com/image_name
    • dockerhub.xxx.com:your worker custom domain name
    • image_name:image name

Other

Telegram Channel: https://t.me/jonssonyan_channel

You can subscribe to my channel on YouTube: https://www.youtube.com/@jonssonyan

If this project is helpful to you, you can buy me a cup of coffee.

Wechat sponsor code

Star History

Star History Chart

License

GPL-3.0