> 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/dai-li-ji-chu-zhi-shi/ru-he-xuan-ze-dai-li-xie-yi.md).

# 如何选择代理协议

代理协议决定了：

👉 程序如何与代理服务器通信。

常见代理协议包括：

```
HTTP
HTTPS
SOCKS5
```

不同协议适合不同业务场景。

***

### 🌍 常见代理协议

| 协议                                                                                        | 特点         |
| ----------------------------------------------------------------------------------------- | ---------- |
| [HTTP](/dai-li-ji-chu-zhi-shi/http-yu-socks5-qu-bie.md#shen-me-shi-http-dai-li)           | 最常用，兼容性高   |
| [HTTPS](/huo-qu-yu-pei-zhi-dai-li/can-shu-shuo-ming/xie-yi-shuo-ming.md#san-https-xie-yi) | 支持加密网页访问   |
| [SOCKS5](/dai-li-ji-chu-zhi-shi/http-yu-socks5-qu-bie.md#shen-me-shi-socks5-dai-li)       | 更通用，支持更多程序 |

***

### ⚙️ HTTP 代理适合什么场景？

HTTP 通常适合：

* 浏览器使用
* [数据采集](/ying-yong-chang-jing/shu-ju-cai-ji.md)
* API 请求
* [Python requests](/kai-fa-zhe-wen-dang/dai-ma-shi-li.md#python-shi-li-requests)
* 普通网页访问

***

### 🌐 HTTP 的特点

HTTP 代理通常：

* 配置简单
* 浏览器兼容性好
* 开发接入方便
* 使用最广泛

👉 大多数用户优先推荐 HTTP。

***

### 🖥 HTTP 示例

```bash
http://username:password@host:port
```

***

### 🔄 SOCKS5 适合什么场景？

SOCKS5 通常适合：

* Telegram
* Discord
* 游戏程序
* 特殊客户端
* 通用网络程序

***

### 🌐 SOCKS5 的特点

SOCKS5 通常：

* 通用性更强
* 支持更多协议
* 更适合复杂程序

***

### 🖥 SOCKS5 示例

```bash
socks5://username:password@host:port
```

***

### 📌 如何快速选择？

可以简单理解：

```
浏览器 / API / 采集 → HTTP
特殊程序 / 客户端 → SOCKS5
```

***

### ⚡ 常见业务推荐

| 场景                                                                                                                | 推荐协议   |
| ----------------------------------------------------------------------------------------------------------------- | ------ |
| Chrome 浏览器                                                                                                        | HTTP   |
| [AdsPower](/ji-cheng-jiao-cheng/zhi-wen-liu-lan-qi/adspower-liu-lan-qi-ji-cheng-zhi-nan.md)                       | HTTP   |
| [Python requests](/kai-fa-zhe-wen-dang/dai-ma-shi-li.md#python-shi-li-requests)                                   | HTTP   |
| [Selenium](/ji-cheng-jiao-cheng/gong-ju-yu-dai-li-ruan-jian/ru-he-zai-selenium-zhong-shi-yong-ipwo-dai-li.md)     | HTTP   |
| [Playwright](/ji-cheng-jiao-cheng/gong-ju-yu-dai-li-ruan-jian/ru-he-zai-playwright-zhong-shi-yong-ipwo-dai-li.md) | HTTP   |
| Telegram                                                                                                          | SOCKS5 |
| Discord                                                                                                           | SOCKS5 |

***

### 🌍 开发者通常怎么选？

大多数开发场景：

👉 HTTP 就已经足够。

因为：

* 兼容性最好
* 文档最多
* 调试更方便

***

### 🔒 SOCKS5 一定比 HTTP 更好吗？

不一定。

区别主要是：

👉 使用场景不同。

不是：

```
SOCKS5 更高级
HTTP 更差
```

***

### ⚠️ 为什么有些软件只能用 SOCKS5？

因为部分程序：

👉 不支持 HTTP 代理。

例如：

* Telegram
* 某些游戏客户端
* 特殊网络工具

***

### 🌐 HTTPS 与 HTTP 什么关系？

很多用户容易混淆：

| 项目       | 含义     |
| -------- | ------ |
| HTTP 代理  | 代理协议   |
| HTTPS 网站 | 网站加密协议 |

实际上：

👉 HTTP 代理同样可以访问 HTTPS 网站。

***

### 💡 推荐选择方案

***

#### 普通用户推荐

建议：

```
HTTP
```

原因：

* 配置最简单
* 浏览器兼容最好
* 文档教程最多

***

#### 开发者推荐

建议：

```
HTTP 优先
特殊场景再使用 SOCKS5
```

***

#### 特殊程序推荐

建议：

```
SOCKS5
```

***

### 🖥 Python HTTP 示例

```python
proxies = {
    "http": "http://user:pass@host:port",
    "https": "http://user:pass@host:port"
}
```

***

### 🖥 Python SOCKS5 示例

```python
proxies = {
    "http": "socks5://user:pass@host:port",
    "https": "socks5://user:pass@host:port"
}
```

***

### ❗ 常见问题

#### 为什么代理无法连接？

可能原因：

* 协议选择错误
* 软件不支持当前协议
* Host 或 Port 配置错误

***

#### [数据采集](/ying-yong-chang-jing/shu-ju-cai-ji.md)推荐哪个协议？

通常：

👉 HTTP 更常见。

***

#### 浏览器推荐 HTTP 还是 SOCKS5？

通常：

👉 HTTP 更简单、更稳定。

***

### 🆘 遇到问题怎么办？

如果出现：

* 软件无法连接代理
* 请求失败
* 代理不生效

建议优先检查：

* 当前协议类型
* 软件是否支持 SOCKS5
* 代理格式是否正确

***

### 总结

代理协议选择建议：

```
普通业务 → HTTP
特殊程序 → SOCKS5
```

👉 选择合适的代理协议能够提升兼容性与稳定性

***


---

# 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:

```
GET https://docs.ipwo.net/dai-li-ji-chu-zhi-shi/ru-he-xuan-ze-dai-li-xie-yi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
