wsl-proxy

WSL2 HTTP proxy setup via Windows host. Automatically detects proxy running on Windows (Clash/V2Ray/SS/Surge etc.) and configures WSL2 environment variables. Trigger when users need to access blocked websites, configure VPN/proxy, or enable external network access from WSL2.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "wsl-proxy" with this command: npx skills add ham-5on/wsl-proxy

WSL2 Proxy — WSL2 代理上网方案

此机器为 WSL2 + Windows 代理工具环境。Skill 会自动扫描宿主机上运行的 HTTP 代理端口,无需用户指定端口号或代理地址。

技能安装路径:skills/wsl-proxy/ 脚本目录:skills/wsl-proxy/scripts/

快速上手

1️⃣ 检测代理

bash skills/wsl-proxy/scripts/detect_proxy.sh

自动扫描宿主机常见端口(7890, 7897, 1080, 10808, 10809, 8888, 8080, 9090, 6152 等),找到可达的 HTTP 代理。

2️⃣ 设置代理(当前 shell)

eval "$(bash skills/wsl-proxy/scripts/setup_proxy.sh)"

自动检测 + 设置环境变量,一步到位。

3️⃣ 检查完整状态

bash skills/wsl-proxy/scripts/check_proxy.sh

显示端口检测结果、环境变量、外网连通性。

4️⃣ 直接使用(不依赖脚本)

HOST_IP=$(ip route show default | awk '{print $3}')
for PORT in 7890 7897 1080 10808 10809 8888 8080 9090; do
    timeout 1 bash -c "echo > /dev/tcp/${HOST_IP}/${PORT}" 2>/dev/null && echo "Port ${PORT} reachable" && break
done
export http_proxy="http://${HOST_IP}:${PORT}"
export https_proxy="http://${HOST_IP}:${PORT}"

5️⃣ 验证

curl -s -o /dev/null -w '%{http_code}' https://www.google.com
# 200 → OK

6️⃣ 清除代理

eval "$(bash skills/wsl-proxy/scripts/unset_proxy.sh)"

永久生效

追加到 ~/.bashrc~/.zshrc

export host_ip=$(ip route show default | awk '{print $3}')
export http_proxy="http://${host_ip}:${PORT}"
export https_proxy="http://${host_ip}:${PORT}"

常见代理端口参考

工具默认端口协议
Clash / Clash Verge7890, 7897HTTP
V2Ray / Xray10808, 10809HTTP/SOCKS
Shadowsocks1080SOCKS5
Surge6152HTTP
Squid3128HTTP
Charles8888HTTP

故障排查

  • 端口全扫不到 → Windows 上代理工具未启动,检查任务栏图标
  • 端口可达但 403 → 代理工具的分流规则未包含目标域名
  • Git 不走代理git config --global http.proxy http://${host_ip}:${PORT}
  • 部分程序不走代理 → 某些程序不读 http_proxy,需单独配置

架构说明

┌────────────────────────┐
│   Windows Host          │
│   Clash/V2Ray/SS etc.   │  ← HTTP proxy (auto-detected port)
└────────┬───────────────┘
         │ 172.x.x.1 (gateway IP)
         ▼
┌────────────────────────┐
│   WSL2 Linux            │
│   curl → http_proxy     │  ← via gateway IP
└────────────────────────┘

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

国顺VPN节点获取

国顺VPN节点获取技能 - 江苏国顺智能科技有限公司专用。自动搜索、测试并整理可用的V2Ray/Clash免费节点订阅链接,验证可用性,输出可导入的节点配置。功能包括:(1)搜索最新免费节点订阅 (2)验证节点可用性 (3)输出各客户端导入教程。使用场景:员工需要VPN时触发,自动获取可用节点并指导导入。

Registry SourceRecently Updated
1650Profile unavailable
Coding

Mihomo CLI

Inspect and operate a local Mihomo/Clash.Meta/Clash Verge/ClashMac instance through its REST API. Use when the user asks to check proxy status, list nodes, r...

Registry SourceRecently Updated
2990Profile unavailable
General

V2ray Proxy

V2Ray代理管理 - 自动开关代理、根据网络状况自动配置系统代理。使用场景:OpenClaw需要访问外网时自动开启代理、不需要时关闭。

Registry SourceRecently Updated
6731Profile unavailable
Web3

币安代理配置(中国大陆)

在中国大陆服务器通过代理访问币安API的完整配置指南。涵盖代理选型、mihomo安装配置、vmess连接、币安域名路由、API签名调用。当用户在中国大陆需要调用币安API、配置币安代理、解决币安API连接问题(Connection reset、HTTP 451区域限制、DNS污染)时使用此技能。

Registry SourceRecently Updated
2781Profile unavailable