# 协议

### HTTP

我们的文档包含代码示例，展示如何使用 `HTTP` 协议连接到代理。该协议受常见库和第三方软件支持。

### HTTPS

您还可以使用完全加密的 `HTTP` 连接，使用 `HTTPS` 协议，以增加一层安全性。为此，您需要添加 `https://` 到你的代理入口地址。例如： `https://pr.oxylabs.io:7777` （这也适用于 [按国家/地区划分的入口节点](/products/cn/dai-li/residential-proxies/location-settings/select-country.md)).&#x20;

请注意，某些库（或其较旧版本）以及某些第三方工具可能不支持 `HTTPS` 协议，因此在更改代码之前请务必再次确认。

### **HTTP/3**

`HTTP3` 可通过能够处理 `UDP` 流量的代理来支持，因为它基于 `QUIC`，一种基于 UDP 的传输协议。

标准 `HTTP`/`HTTPS` 代理端点与 `HTTP3`不兼容，因此要代理请求，您需要使用一个带有 `SOCKS5` 代理 `UDP` 流量支持的代理，可通过以下专用端点使用：

```
socks.pr.oxylabs.io:7777
```

大多数常见工具并不原生支持 `HTTP3` 通过 `SOCKS5` ，并且 `UDP`，因此可能需要自定义实现，例如我们的自定义 [HTTP/3 Go 解决方案](https://github.com/oxylabs/gohttp3viaSOCKS5UDP) ，位于 GitHub。

{% hint style="info" %}
**注意：** 请确保您的防火墙允许所需端口上的 UDP 流量，因为许多端口默认会阻止 UDP
{% endhint %}

### **SOCKS5**&#x20;

{% hint style="info" %}
`SOCKS5` `UDP` 连接现已提供测试版。请联系您的客户经理或客户成功团队以启用测试。
{% endhint %}

Oxylabs 住宅代理 `SOCKS5` 协议无法与 Chrome 配合使用，因此我们建议改用 Firefox。

我们的住宅代理目前仅支持 `TCP` 连接。\
要使用 `SOCKS5` 协议，你需要添加 `socks5h` 在您的请求中，例如：

```bash
curl -x socks5h://pr.oxylabs.io:7777 -U "customer-USERNAME:PASSWORD" ip.oxylabs.io/location
```

请注意，目前， `SOCKS5` 协议不支持按国家/地区指定的入口节点。您可以通过在用户名中添加 [**附加参数**](/products/cn/dai-li/residential-proxies/making-requests.md) 来定位特定位置。以下是定位法国的示例：

```bash
curl -x socks5h://pr.oxylabs.io:7777 -U "customer-USERNAME-cc-FR:PASSWORD" ip.oxylabs.io/location
```

{% hint style="info" %}
请注意，某些网站在使用`SOCKS5` 协议时可能会识别出代理 IP。在这种情况下，我们强烈建议切换到其他协议。&#x20;
{% endhint %}

### 代理端口

代理端口的默认配置包括 `80` 和 `443`，这些是为适配下列 `HTTP` 和 `HTTPS` 协议而设计的标准端口，如下表所示。要访问其他端口，需要进行合规性验证，请联系我们的 [**支持**](mailto:support@oxylabs.io).

| 协议      | 端口  |
| ------- | --- |
| `HTTP`  | 80  |
| `HTTPS` | 443 |


---

# Agent Instructions: 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://developers.oxylabs.io/products/cn/dai-li/residential-proxies/protocols.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.
