← Back to Skills Marketplace
ham-5on

WSL Proxy

by Ham-5on · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
52
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install wsl-proxy
Description
WSL2 HTTP proxy setup via Windows host. Automatically detects proxy running on Windows (Clash/V2Ray/SS/Surge etc.) and configures WSL2 environment variables....
README (SKILL.md)

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 Verge 7890, 7897 HTTP
V2Ray / Xray 10808, 10809 HTTP/SOCKS
Shadowsocks 1080 SOCKS5
Surge 6152 HTTP
Squid 3128 HTTP
Charles 8888 HTTP

故障排查

  • 端口全扫不到 → 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
└────────────────────────┘
Usage Guidance
This skill is reasonable for WSL2 proxy setup. Review the shell output before using the eval command, remember that enabling http_proxy and https_proxy can route later command-line traffic through the Windows proxy, and only make the bashrc/zshrc change if you want the proxy to persist across sessions.
Capability Analysis
Type: OpenClaw Skill Name: wsl-proxy Version: 1.0.0 The wsl-proxy skill is a utility designed to automate the configuration of HTTP proxy settings in a WSL2 environment by detecting proxy services running on the Windows host. The scripts (detect_proxy.sh, setup_proxy.sh, etc.) use standard networking commands to identify the host gateway and scan common proxy ports (e.g., 7890, 10809). No evidence of data exfiltration, malicious persistence, or obfuscation was found; the use of eval in setup_proxy.sh is a standard pattern for modifying shell environment variables and is restricted to the script's own output.
Capability Assessment
Purpose & Capability
The stated purpose is WSL2 proxy setup, and the included scripts detect the WSL gateway, check common proxy ports, and emit proxy environment variables consistent with that purpose.
Instruction Scope
The setup flow uses eval to apply generated shell commands in the current shell. This is disclosed and scoped to proxy environment variables, but users should only run it from the reviewed skill path.
Install Mechanism
There is no package install, remote script download, or hidden installer; the shell scripts are included in the provided file manifest.
Credentials
The scripts perform local gateway port probing and external connectivity checks, which are proportionate for proxy discovery but may be visible to the local proxy or test websites.
Persistence & Privilege
Persistent proxy configuration is presented as an optional user action for shell startup files; the provided scripts do not automatically modify those files.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install wsl-proxy
  3. After installation, invoke the skill by name or use /wsl-proxy
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: auto-detect Windows HTTP proxy port from WSL2, configure environment variables, verify connectivity
Metadata
Slug wsl-proxy
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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.... It is an AI Agent Skill for Claude Code / OpenClaw, with 52 downloads so far.

How do I install WSL Proxy?

Run "/install wsl-proxy" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is WSL Proxy free?

Yes, WSL Proxy is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does WSL Proxy support?

WSL Proxy is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created WSL Proxy?

It is built and maintained by Ham-5on (@ham-5on); the current version is v1.0.0.

💬 Comments