# Proxychains

Auto-detect network issues and force proxy usage with proxychains4.

- Repository: https://github.com/2025Emma/vibe-coding-cn (23122 stars)
- Category: Engineering
- License: MIT
- Last updated: 2025-12-17
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add 2025Emma/vibe-coding-cn --skill proxychains -g -a claude-code -y`
Codex: `npx skills add 2025Emma/vibe-coding-cn --skill proxychains -g -a codex -y`
Cursor: `npx skills add 2025Emma/vibe-coding-cn --skill proxychains -g -a cursor -y`
Gemini CLI: `npx skills add 2025Emma/vibe-coding-cn --skill proxychains -g -a gemini-cli -y`

## Description

Auto-detect network issues and force proxy usage with proxychains4. Use this skill when encountering connection timeouts, DNS failures, or blocked network access. Default proxy is http://127.0.0.1:9910

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Proxychains Network Proxy Skill

**自动使用代理解决网络问题** - 当遇到网络连接失败、超时或访问受限时，自动使用 proxychains4 强制走代理。

## When to Use This Skill

**触发条件（自动应用）:**
- ❌ Connection timeout errors
- ❌ DNS resolution failures
- ❌ "Connection refused" errors
- ❌ HTTP 403/451 blocked access
- ❌ GitHub/PyPI/npm 等国外资源访问失败
- ❌ curl/wget/git/pip 等命令失败

**Claude 应该：**
1. 检测到网络错误后，自动在命令前添加 `proxychains4`
2. 使用默认代理配置：`http://127.0.0.1:9910`
3. 如果代理失败，提示用户检查代理服务状态

## Quick Reference

### 基本用法模式

```bash
# ❌ 原命令失败
curl https://github.com/user/repo

# ✅ 使用代理重试
proxychains4 curl https://github.com/user/repo
```

### 常见场景自动应用

**场景 1: Git 操作失败**
```bash
# 原命令
git clone https://github.com/user/repo.git

# 自动改为
proxychains4 git clone https://github.com/user/repo.git
```

**场景 2: Python pip 安装失败**
```bash
# 原命令
pip install requests

# 自动改为
proxychains4 pip install requests
```

**场景 3: npm/yarn 安装失败**
```bash
# 原命令
npm install package-name

# 自动改为
proxychains4 npm install package-name
```

**场景 4: wget/curl 下载失败**
```bash
# 原命令
wget https://example.com/file.tar.gz

# 自动改为
proxychains4 wget https://example.com/file.tar.gz
```

**场景 5: Docker 拉取镜像失败**
```bash
# 原命令
docker pull image:tag

# 自动改为
proxychains4 docker pull image:tag
```

**场景 6: SSH 连接失败**
```bash
# 原命令
ssh user@remote-host

# 自动改为
proxychains4 ssh user@remote-host
```

## 配置详情

### 默认代理配置

**本地代理地址：** `http://127.0.0.1:9910`

**配置文件位置：**
- `~/.proxychains/proxychains.conf` (推荐)
- `/etc/proxychains.conf` (系统级)

### 快速配置脚本

创建用户级配置（自动使用 127.0.0.1:9910）：

```bash
mkdir -p ~/.proxychains
cat > ~/.proxychains/proxychains.conf << 'EOF'
# Proxychains configuration
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000

[ProxyList]
http 127.0.0.1 9910
EOF
```

### 环境变量方式（临时使用）

```bash
# 设置代理环境变量
export PROXYCHAINS_SOCKS5_HOST=127.0.0.1
export PROXYCHAINS_SOCKS5_PORT=9910

# 使用
proxychains4 curl https://github.com
```

## 工作原理

Proxychains 通过 LD_PRELOAD 机制拦截程序的网络调用：

The rest: https://github.com/2025Emma/vibe-coding-cn/blob/HEAD/i18n/zh/skills/proxychains/SKILL.md
