Skip to content
Proyectos

jonssonyan/cf-workers-proxy

Ver en GitHub

Acerca de

Proxy inverso HTTP para Cloudflare Workers

Sistemas e infraestructura

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

Cloudflare Workers Proxy

English / 简体中文

Cloudflare Workers HTTP 反向代理

License: GPL-3.0 GitHub stars GitHub forks GitHub release

建议自用,使用正则表达式过滤请求,并设置 worker 自定义域名,禁止代理全站,例如:GitHub,否则导致账号被官方风控概不负责

理论上支持代理任何被屏蔽的域名,只需要设置环境变量 PROXY_HOSTNAME 为被屏蔽的域名,最后通过你的 worker 自定义域名访问即可

部署

注意:大部分情况使用 _worker.js 部署即可,但是部分代理地址要特殊处理,部署时请使用指定的文件

名称 文件
通用 _worker.js
Docker docker.js

环境变量

变量名 必填 默认值 示例 备注
PROXY_HOSTNAME √ github.com 代理地址 hostname
PROXY_PROTOCOL × https https 代理地址协议
PATHNAME_REGEX × ^/jonssonyan/ 代理地址路径正则表达式
UA_WHITELIST_REGEX × (curl) User-Agent 白名单正则表达式
UA_BLACKLIST_REGEX × (curl) User-Agent 黑名单正则表达式
IP_WHITELIST_REGEX × (192.168.0.1) IP 白名单正则表达式
IP_BLACKLIST_REGEX × (192.168.0.1) IP 黑名单正则表达式
REGION_WHITELIST_REGEX × (JP) 地区白名单正则表达式
REGION_BLACKLIST_REGEX × (JP) 地区黑名单正则表达式
URL302 × https://github.com/jonssonyan/cf-workers-proxy 302 跳转地址
KEEP_PATH × false false 302 跳转时保留 path
DEBUG × false false 开启调试

镜像仓库加速

  1. 将环境变量 PROXY_HOSTNAME 设置为以下镜像仓库地址即可
镜像仓库 地址
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. 设置 Docker 镜像仓库加速

    将 https://dockerhub.xxx.com 替换为你的 worker 自定义域名

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

    docker search dockerhub.xxx.com/image_name
    
    • dockerhub.xxx.com:你的 worker 自定义域名
    • image_name:镜像名称

其他

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

你可以在 YouTube 上订阅我的频道: https://www.youtube.com/@jonssonyan

如果这个项目对你有帮助,你可以请我喝杯咖啡:

微信赞赏码

贡献者

在这里感谢所有为此项目做出贡献的人

Star History

开源协议

GPL-3.0

Explorar proyectos relacionados

Cargando…