A multi-client subscription converter and chained proxy tool that transforms standard VPN node subscriptions into various client formats and appends a residential broadband exit proxy.

Stars

5

7-day growth

No data

Forks

0

Open issues

1

License

MIT

Last updated

2026-07-27

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It uniquely integrates subscription conversion with a residential IP chain proxy, supports six major client formats, and can be deployed instantly on Cloudflare Workers with zero exposure of sensitive home network credentials.

Who it is for

  • VPN subscription users who need multi-client compatibility
  • Self-hosters with a residential exit node
  • Cloudflare Workers developers
  • Users wanting to visually monitor traffic and expiry data

Use cases

  • Convert an airport subscription to Clash, Sing-box, Surge, Quantumult X, or Shadowrocket format
  • Chain a residential broadband proxy after each VPN node for a clean exit IP
  • One-click import into supported clients via deep links
  • Display remaining traffic and expiration countdown on a Web UI or client profile

Strengths

  • Supports six client formats (Clash/Mihomo, Sing-box, Surge, Quantumult X, Shadowrocket, generic)
  • Residential proxy credentials stored entirely in environment variables, never exposed in config files
  • Deployable in two minutes via Cloudflare Workers one-click button or Wrangler CLI
  • Built-in Web UI for generating subscriptions and one-click client import links

Considerations

  • Only works on Cloudflare Workers (no self-hosted server alternative)
  • Requires a separate residential exit proxy to be configured (not provided by the tool)
  • Relies on third-party subscription nodes and Cloudflare infrastructure for stability

README quick start

🚀 多客户端订阅转换器与链式代理(cf-sub)

⚡ 一个多客户端机场订阅转换工具与家宽链式代理节点注入工具


📖 项目简介

cf-sub 可以将标准的机场节点订阅转化为支持多客户端格式(Clash / MihomoSing-boxSurgeQuantumult XShadowrocket)的配置。为机场节点自动附加后置家宽代理(支持 SOCKS5, HTTP, HTTPS, SS, Trojan, VLESS 出口),以家宽 IP 作为终点出口,同时保留机场原生节点与原有的分流策略。


🌟 核心特性

  • 🌐 多客户端
    • Clash / Mihomo (YAML) -> 利用 dialer-proxy 链式代理
    • Sing-box (JSON 1.8+) -> 利用 detour 链式代理
    • Surge (.conf) -> 利用 under-proxy 链式代理
    • Quantumult X -> 策略组与节点转换
    • Shadowrocket / 通用节点 -> Base64 编码与单行 URI 列表
  • 🛡️ 家宽敏感信息零暴露:支持在 Workers 环境变量中存储家宽 IP、端口与密码。
  • 📊 剩余流量与到期时间显示:在客户端卡片及 Web UI 中直观展示已用流量、剩余流量及到期倒计时。
  • 🔗 一键客户端导入:可一键生成并调用 clash://, sing-box://, surge://, sub:// 客户端快捷导入链接。

🏗️ 工作原理

[ 用户客户端 (Clash / Sing-box / Surge) ] 
            │
            ▼ (访问目标网站)
    [ 前置节点 (机场节点) ] ── (中继流量) ──► [ 出口节点 (家宽出口) ] ──► [ 目标网站 ]

⚡ 部署指南

方式一:网页一键部署 (推荐)

1、Fork 本仓库

2、点击下方按钮,登录 Cloudflare 账号

3、在 Cloudflare 中连接你 Fork 的仓库


方式二:命令行部署 (使用Wrangler CLI)

# 1. 克隆项目仓库
git clone https://github.com/Mareixcode/cf-sub.git
cd cf-sub

# 2. 安装依赖
npm install

# 3. 部署至 Cloudflare Workers
npx wrangler deploy

⚙️ 配置说明

方法 A:使用 Web UI 界面

填入机场订阅,选择目标客户端与家宽出口协议(若家宽信息已配置在环境变量中,可保持留空),点击生成订阅链接一键导入客户端

方法 B:Cloudflare 后台环境变量配置 (推荐)

前往 Cloudflare Dashboard -> Workers & Pages -> 选择您的 Worker -> Settings -> Variables,添加以下环境变量:

变量名说明示例
SOCKS_TYPE出口协议类型 (socks5 | http | https | ss | trojan | vless)socks5
SOCKS_SERVER家宽出口服务器 IP 或域名1.2.3.4exit.example.com
SOCKS_PORT出口服务端口1080
SOCKS_USERNAME认证用户名 (可选)user
SOCKS_PASSWORD认证密码 (可选)pass

📡 API 路由与动态参数

  • 订阅转换端点GET /sub
    • url: 原始机场订阅 URL(需 URL 编码)
    • target: 目标客户端 (clash, singbox, surge, quanx, shadowrocket)
    • socks_type: 出口协议类型 (socks5, http, https, ss, trojan, vless)
    • socks_server: 家宽出口 IP/域名 (可选)
    • socks_port: 家宽出口端口 (可选)

🙏 致谢

Related repositories

Similar projects matched by category, topics, and programming language.

TanStack
Featured
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web DevelopmentFrontend Frameworks
14,861
vercel-labs
Featured
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

Developer ToolsCode Quality & Build
1,985
Jakubantalik
Featured
Jakubantalik GitHub avatar

thinking-orbs

A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.

AI & Machine LearningAI Agents
1,191