wsl-singbox-tun

作者 sway913已验证

部署tun代理网络

0
Stars
0
Forks
Python
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/sway913/wsl-singbox-tun

快速入门

使用 wsl-singbox-tun 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

wsl-singbox-tun

在 WSL2 上一键部署/排障 sing-box 1.13 + VLESS Reality Vision + TUN 代理:只让 WSL 内部流量(git / curl / docker / npm / claude-code / AI Agent...)走代理, Windows 宿主机完全不受影响。

能做什么

  • 部署:传入一条 vless:// 节点链接,自动完成安装 sing-box、生成 /etc/sing-box/config.json、建 systemd 服务、启动并验证、调优内核 TCP keepalive、对齐时区/locale 到 VPS 区域的全流程。
  • 排障(连不上):当某个内网地址/域名在 WSL 里连不上、但停掉 sing-box 就 恢复正常时,自动判断是不是该网段被误路由进了代理隧道,并给出修复方式。
  • 排障(卡顿):当 Claude Code 等长连接工具用一段时间后卡死几分钟到十几 分钟、之后自愈或报错(停 sing-box 不会立刻好转)时,诊断并修复内核 TCP keepalive 参数过长导致的连接假死问题。
  • 降指纹(封号风险):把 WSL 系统时区/locale 从中国区(Asia/Shanghai、 UTC+8、zh_CN)对齐到代理出口 VPS 所在区域,降低 Claude Code / Codex 通过 OS 时区隐写指纹判成「中国用户」的概率。可用 curl https://fuck-claude.vercel.app/api/check 自检。

依赖环境

  • WSL2,已在 /etc/wsl.conf 启用 systemd=true
  • /dev/net/tun 可用(较新版本 WSL 内核默认支持)
  • sudo 权限(安装软件、写 /etc/sing-box//etc/systemd/system/、时区/locale)
  • 只支持 vless + reality + xtls-rprx-vision + tcp 这一种组合,其他协议/传输 方式(ws、grpc、trojan、shadowsocks 等)暂不支持

用法

# 部署
bash scripts/deploy.sh 'vless://uuid@host:port?encryption=none&flow=xtls-rprx-vision&security=reality&sni=...&fp=...&pbk=...&sid=...&type=tcp&headerType=none#remark'

# 追加/替换需要直连(不走代理)的内网网段
bash scripts/deploy.sh 'vless://...' --extra-exclude 10.20.0.0/16
bash scripts/deploy.sh 'vless://...' --exclude 127.0.0.0/8,10.20.0.0/16

# 排障:内网地址连不上
bash scripts/troubleshoot.sh code.example.com
bash scripts/troubleshoot.sh 10.20.5.10

# 排障:长连接卡顿几分钟到十几分钟后自愈/报错(如 Claude Code)
bash scripts/fix_tcp_keepalive.sh

# 对齐时区/locale 到 VPS 出口区域(降 Claude Code / Codex 中国区指纹)
bash scripts/fix_locale_timezone.sh
bash scripts/fix_locale_timezone.sh --check
bash scripts/fix_locale_timezone.sh --timezone America/Los_Angeles
curl -sS https://fuck-claude.vercel.app/api/check

在 Claude Code 里直接把 vless 链接发给 Claude 并说"帮我部署这个代理"或"这个 内网地址连不上"或"帮我对齐时区防封号"即可自动触发,细节见 SKILL.md

目录结构

scripts/
  parse_vless.py         解析 vless:// 链接 -> JSON
  render_config.py        JSON 字段 -> sing-box config.json(默认只排除 127.0.0.0/8)
  add_exclude_cidr.py     给已有 config.json 追加直连网段(排障用)
  check_route_hit.py      判断某个 IP 是否命中策略路由表(排障用)
  deploy.sh                串联以上脚本 + apt/systemctl,完成从零部署
  troubleshoot.sh          排障入口,只诊断不动手改配置(内网连不上)
  fix_tcp_keepalive.sh    诊断并修复长连接假死卡顿(改内核 sysctl)
  fix_locale_timezone.sh  对齐 WSL 时区/locale 到 VPS 区域(降中国区指纹)
references/
  WSL2_singbox_TUN_2026.md   完整部署文档(唯一真实来源),示例用占位信息

注意事项

  • deploy.sh 会真实执行 sudo apt install、覆盖 /etc/sing-box/config.json、 重启 sing-box 服务;已有配置会自动备份成 config.json.bak.<日期>,但仍 建议先确认再执行,尤其是机器上已有一套在用的代理配置时。
  • route_exclude_address 默认只有 127.0.0.0/8(本机回环)。任何公司/家庭 内网、局域网服务默认都会被送进代理隧道,第一次部署时记得用 --extra-exclude 把自己的内网网段加进去,别等出问题了再补。
  • fix_locale_timezone.sh 会改 /etc/wsl.conf(关闭 Windows 时区同步)、 系统时区与 locale。改完 wsl.conf 后需在 Windows 侧 wsl --shutdown 一次 才持久生效。浏览器侧指纹(字体/UA/设备品牌等)不在本脚本范围。

常见问题

What is wsl-singbox-tun?

wsl-singbox-tun is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by sway913. 部署tun代理网络. It has 0 GitHub stars.

Is wsl-singbox-tun safe to use?

Yes. wsl-singbox-tun passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install wsl-singbox-tun?

Clone the repository with "git clone https://github.com/sway913/wsl-singbox-tun" and add it to your Claude Code skills directory (see the Installation section above). wsl-singbox-tun ships a SKILL.md manifest, so compatible agents can discover and load it automatically.

What programming language is wsl-singbox-tun written in?

wsl-singbox-tun is primarily written in Python. It is open-source under sway913 on GitHub, so you can review or fork the full source.

Are there alternatives to wsl-singbox-tun?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh wsl-singbox-tun against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情