clash-chain-proxy
Skill3 starsChanged 21 days agoMITView on GitHub
根据用户提供的代理节点、Clash YAML 或节点分享链接,以及静态住宅 SOCKS5 信息,生成可导入 Clash Verge / Mihomo 的链式代理 YAML,校验配置并按需测试实际连接与出口 IP。用于创建住宅 IP 链式代理配置。
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jiangkaiqi2005/jiangkaiqi-Skillstheir own version, first seen Sep 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jiangkaiqi2005/jiangkaiqi-Skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Files
Clash Verge 住宅 IP 链式配置
交付可下载的 YAML 文件,以及明确区分的结构检查、Mihomo 内核检查、真实联网测试结果。
链路为:本机 → 用户提供的中转节点 → 住宅 SOCKS5 → 目标网站。
住宅节点上的 dialer-proxy 指向中转节点;不能反过来。
收集和整理输入
从当前对话及用户指定文件中获取:
- 中转节点:Clash 内联
proxies、单节点字段、分享链接,或口述的协议/服务器/端口/认证及必要的 TLS/传输参数。 - 住宅 SOCKS5:服务器、端口、用户名和密码(或明确无认证)。
- 可选:节点过滤条件、住宅服务商确认的公网出口 IP、输出文件路径。
信息足够就执行,仅询问实际缺失的必填字段。不要编造节点、密码、TLS servername、Reality 公钥或传输路径。原始订阅只有远程 providers 时,需获取并展开用户授权的节点源,不能把 provider URL 当节点。不要向第三方在线订阅转换器提交凭据。
将分享链接或口述信息整理为本地节点 YAML;复杂协议的必要字段不明确时查 Mihomo 对应协议官方文档。保留用户节点的认证、TLS、传输配置。脚本接受 proxies 映射、节点列表或单节点映射。住宅文件支持 YAML/JSON 映射、host:port:user:password、host:port 或 socks5://user:password@host:port。含冒号的密码使用前一种或 YAML;IPv6 和含特殊字符的账号优先使用 YAML,URL 凭据需要百分号编码。
输入文件以 0600 权限写入独立临时目录,完成后删除临时凭据。不要在命令行参数、日志或最终答复中重复密码。最终 YAML 本身包含使用所必需的凭据,只交付给用户。
生成并检查
设 SKILL_DIR 为本 SKILL.md 所在目录。使用 $SKILL_DIR/.venv/bin/python;若没有环境,则用 Python 3.9+ 创建该目录下的 .venv,并安装 requirements.txt,不要修改系统 Python。脚本不会自行联网安装依赖。
"$SKILL_DIR/.venv/bin/python" "$SKILL_DIR/scripts/chain_proxy.py" \
--nodes /absolute/path/nodes.yaml \
--residential /absolute/path/residential.yaml \
--output /absolute/path/clash-chain.yaml- 多节点时可按用户需求加
--auto-select,创建自动测速选择组(周期访问 gstatic generate_204),默认不开启;加--ip-name可自定义住宅节点后缀。测速候选仅包含住宅链路,不能加入 DIRECT 或第一跳单独出口。 - 可加
--filter '香港|日本',不匹配或正则错误会停止,不回退到全部节点。 - 自动查找 PATH 中的
mihomo或 macOS Clash Verge 自带内核;其他位置使用--mihomo /path/to/mihomo。 - 输出前执行隔离的
mihomo -t。失败就修复后重试;缺少内核时说明无法完成内核验证,不宣称可直接使用。 - 默认端口 7890,可用
--port改变。输出不覆盖已有文件,除非明确需要替换时加--force;禁止覆盖输入。 - 原订阅仅提取节点。生成新的链式选择组和 MATCH 规则,不沿用订阅的旧分组、规则、providers、控制器或 TUN 设置。用户若要保留旧分流,这是额外的合并任务,应单独处理并再次内核验证。
- 中转节点已有
dialer-proxy时拒绝,以免隐式形成多跳或循环;获取独立的第一跳节点再生成。 - 默认不开放局域网,不启用 TUN,不加入 DIRECT 回退。住宅 UDP 默认为 false;只有确认住宅服务支持时才设置 true。配置并不声称消除 DNS 泄漏;默认名称解析由内核/系统处理。
实际连接测试
用户要求“验证测试”且提供真实节点时,添加 --probe 对每条链路执行 HTTPS 出口查询;若知道服务商确认的公网出口,加 --expected-exit-ip。测试访问 https://api.ipify.org,每条链路启动临时内核、使用随机回环端口并在完成后关闭。不切换 Clash Verge 当前配置,不修改系统代理。
"$SKILL_DIR/.venv/bin/python" "$SKILL_DIR/scripts/chain_proxy.py" \
--nodes /absolute/path/nodes.yaml --residential /absolute/path/residential.yaml \
--output /absolute/path/clash-chain.yaml --probe --expected-exit-ip 203.0.113.10上面的地址仅是示例,必须换成真实已知值或省略该参数。SOCKS5 接入服务器地址不一定等于出口公网 IP,不能直接拿二者比较。脚本返回 0 表示所请求的检查通过,1 表示生成/验证/执行错误,2 表示有链路联网失败或出口不符;联网失败时已生成的 YAML 仍保留,需明确告知。内核原始日志可能包含敏感字段,脚本默认不打印;必要时仅在本机私密临时目录诊断,展示前脱敏。
真实测试仅证明当时 HTTPS TCP 和所测出口,不证明 UDP、所有网站或住宅属性;没有真实凭据或网络受限时明确标记“未测试”,不拿模拟测试代替。
交付
提供 YAML 文件链接,说明通过哪些检查、每条实测链路的结果/出口(若已测),并给出简短导入说明:在 Clash Verge 的订阅/Profiles 页面创建本地配置或导入文件,启用后在实际生成的住宅 IP 选择组中选择链路。UI 名称可能随版本变化,不承诺固定按钮名称。Clash Verge 的合并脚本、全局覆写可能改变最终运行配置;遇到差异检查实际运行配置。
仅生成文件不等于切换当前网络配置;用户明确要求应用时再执行应用操作。
维护脚本后运行 tests/test_chain_proxy.py;两跳转发回归使用 tests/test_local_chain.py,需允许本机回环监听。两者使用合成数据,不用于宣称用户真实节点可连接。
官方依据:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

