> 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)
