> For the complete documentation index, see [llms.txt](https://docs.ipwo.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipwo.net/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/dai-li-lian-jie-shi-bai.md).

# 代理连接失败

如果出现以下情况：

```
Proxy connection failed
Failed to connect to proxy
Could not connect to proxy server
```

通常表示：

```
客户端无法与代理服务器建立连接
```

这是最基础但也最常见的代理错误之一。

***

### 一、常见原因

#### 1. 代理地址或端口错误

请检查：

* Host 是否正确
* 端口是否正确
* 是否写错协议

***

#### 正确示例

```bash
curl -x http://us.ipwo.net:7878 -U username_custom_zone_us:password http://ipinfo.io
```

***

#### 2. 网络无法访问代理服务器

常见于：

* 国内网络限制
* 公司网络防火墙
* VPS 出口限制

***

#### 3. 代理协议不匹配

例如：

* HTTP 代理用 SOCKS5 写法
* SOCKS5 用 HTTP 写法

***

#### 4. [白名单未配置或未生效](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/bai-ming-dan-bu-sheng-xiao.md)

如果使用白名单模式：

```
当前 IP 未加入白名单
```

***

#### 5.[ DNS 解析失败](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/dns-jie-xi-shi-bai.md)

可能导致：

```
无法解析 us.ipwo.net
```

***

### 二、常见错误示例

#### cURL

```
curl: (7) Failed to connect to us.ipwo.net port 7878
```

***

#### Python

```python
requests.exceptions.ProxyError
```

***

#### Node.js

```
ECONNREFUSED
```

***

### 三、推荐排查方式

#### 1. curl 基础测试

```bash
curl -v -x http://us.ipwo.net:7878 -U username_custom_zone_us:password http://ipinfo.io
```

***

#### 2. 检查 DNS 是否正常

```bash
nslookup us.ipwo.net
```

***

#### 3. 更换网络环境

建议测试：

* 手机热点
* 海外 VPS
* 不同网络

***

#### 4. 检查白名单

确认当前公网 IP 是否已添加。

***

### 四、推荐解决方案

建议：

* 使用稳定网络环境（海外 VPS）
* 确认代理账号正确
* 使用 curl 先验证
* 检查 DNS 与端口

***

### 五、推荐排查流程

```
1. 检查代理账号
↓
2. 检查 Host / Port
↓
3. curl 测试连接
↓
4. 检查 DNS
↓
5. 检查白名单
↓
6. 更换网络测试
```

***

### 六、相关文章

* [407 Proxy Authentication Required](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/407-proxy-authentication-required.md)
* [超时 Timeout](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/chao-shi-timeout.md)
* [DNS 解析失败](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/dns-jie-xi-shi-bai.md)
* [IP 不生效](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/ip-bu-sheng-xiao.md)
* [白名单不生效](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/bai-ming-dan-bu-sheng-xiao.md)
* [如何检测代理是否生效](/dai-li-jian-ce-yu-yin-si-an-quan/ru-he-jian-ce-dai-li-shi-fou-sheng-xiao.md)
* [HTTP 与 SOCKS5 区别](/dai-li-ji-chu-zhi-shi/http-yu-socks5-qu-bie.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ipwo.net/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/dai-li-lian-jie-shi-bai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
