> 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/407-proxy-authentication-required.md).

# 407 Proxy Authentication Required

```
407 Proxy Authentication Required
```

表示：

```
代理认证失败
```

通常是：

* 用户名错误
* 密码错误
* 代理格式错误
* zone/session 参数错误

这是开发者接入代理时最常见的问题之一。

***

### 一、常见报错示例

#### cURL

```
curl: (56) Received HTTP code 407 from proxy after CONNECT
```

***

#### Python

```
ProxyError: 407 Proxy Authentication Required
```

***

### 二、正确请求示例

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

***

### 三、常见原因

***

#### 1️⃣ 用户名或密码错误

请检查：

* 用户名是否完整
* 密码是否正确
* 是否复制了空格

***

#### 2️⃣ zone 参数错误

错误示例：

```
username
```

正确示例：

```
username_custom_zone_us
```

***

#### 3️⃣ 代理协议错误

HTTP：

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

SOCKS5：

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

***

#### 4️⃣ 白名单与账密认证冲突

如果开启了：

```
IP 白名单认证
```

部分情况下无需再填写用户名密码。

***

### 四、推荐排查方式

建议先使用 curl 测试：

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

重点检查：

* 用户名
* 密码
* zone 参数
* 协议类型

***

### 五、Windows 用户注意事项

建议使用双引号：

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

避免特殊字符解析异常。

***

### 六、如何确认已修复？

重新执行：

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

如果正常返回 IP 与国家信息，则说明认证成功。

***

### 七、相关文章

* [获取代理信息](/huo-qu-yu-pei-zhi-dai-li.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)
* [超时 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)
* [代理连接失败](/kai-fa-zhe-wen-dang/chang-jian-cuo-wu/dai-li-lian-jie-shi-bai.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/407-proxy-authentication-required.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.
