Skip to content

Latest commit

 

History

History
86 lines (63 loc) · 4.64 KB

README_EN.md

File metadata and controls

86 lines (63 loc) · 4.64 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

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

Other

you can contact me at YouTube: https://www.youtube.com/@jonssonyan

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

Wechat sponsor code

License

GPL-3.0