> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 介绍

> 住宅代理高级参数规范以控制您的连接

Decodo 通过单个**回连**端点和端口提供可自定义的代理访问：`gate.decodo.com:7000`。

要在请求中指定所有代理参数，您可以使用以下两种方法之一：

1. [**用户名和密码**](https://help.decodo.com/docs/cn/residential-proxy-user-pass-requests)。
2. [**白名单 IP**](https://help.decodo.com/docs/cn/residential-proxy-whitelisted-ip-requests)。

***

## 可用参数

| 参数                | 示例值               | 描述                                                                                     |
| ----------------- | ----------------- | -------------------------------------------------------------------------------------- |
| `country`         | `us`              | 国家代码。请以两个字母的 ISO 格式提供。您可以在[**这里**](https://www.iban.com/country-codes)查看大多数 ISO 国家代码。  |
| `city`            | `berlin`          | 城市名称。添加此参数可以指定您想要使用的 IP 地址所在的城市。请将此参数与 `country` 参数一起使用。                               |
| `state`           | `us_california`   | 美国州。当您选择 `us` 作为国家参数时支持**美国**位置。它将允许您指定想要使用的 IP 所在的美国州。                                |
| `session`         | `randomstring123` | 用于创建会话的随机字符串，允许同一 IP 用于多个请求。会话默认在 `10` 分钟内自动过期。之后，将为此会话 ID 分配新的 IP。                    |
| `sessionduration` | `180`             | 与 `session` 一起使用。以分钟为单位指定粘性会话时间 - 可以设置为 `1` 到 `1440` 之间的任何数字，以覆盖 `10` 分钟的粘性会话默认值。      |
| `zip`             | `10001`           | **5 位数**的 `ZIP` 代码。添加此参数可以指定您想要定位的 ZIP 代码位置。它仅适用于定位**美国**位置，应与 `country-us` 参数字符串一起使用。 |
| `asn`             | `20057`           | 定位特定运营商的 ASN 号码。您可以通过在线搜索查找运营商号码，例如[**这里**](https://asnlookup.com)。                    |
| `continent`       | `as`              | 大陆代码。                                                                                  |

<Note>
  ### ASN 过滤

  * 您必须在 `city` 定位和 `asn` 定位之间选择，因为它们不能同时使用。
  * 相同的逻辑也适用于 `continent`、`state` 和 `country` 参数。
</Note>

***

## 应用程序支持

### 用户名:密码方法

回连入口节点也可以在各种应用程序中使用。在这种情况下，您需要在**用户名**字段中传递会话的每个参数，如下所示：

`user-username-country-country_code-city-city_name-session-randomstring`

在上面的示例中，`username` 代表您的代理用户名，您需要从身份验证部分获取。在 `password` 字段中，您只需输入代理用户的密码。

更多信息请参阅我们的[**用户名:密码请求**](https://help.decodo.com/docs/cn/residential-proxy-user-pass-requests#/)部分。

<Note>
  **会话 ID** 可以由您选择的任何字符串定义（只需替换示例中的"randomstring123"）。仅当您想要粘性会话时才使用**会话 ID**。否则，只需忽略该部分即可接收**轮换代理**。

  当城市或州名称由多个单词组成时，请使用下划线。例如：`las_vegas`、`us_new_york` 或 `us_rhode_island`。
</Note>

### 白名单 IP 方法

由于此方法不包含用户名，您必须在**端点**中指定回连参数，如下所示：

`https://country-country_code-city-city_name-session-randomstring.gate.decodo.com:7000`

更多信息请参阅我们的[**白名单 IP 请求**](https://help.decodo.com/docs/cn/residential-proxy-whitelisted-ip-requests/)部分。

<Warning>
  ### 白名单 IP 身份验证限制

  * **白名单 IP** 身份验证仅支持 `HTTPS` 请求。
  * 白名单 IP 身份验证目前不支持 `IPv6` IP 地址。请使用 `IPv4` 格式的 IP（`xx.xx.xx.xx`）。
</Warning>

***

## cURL 示例

要使用这些命令，只需将 `username` 和 `password` 替换为您的代理用户凭据，然后在终端或命令提示符中运行它们。

##### 从随机位置获取具有轮换会话的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "username:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定国家（在此示例中为意大利）获取具有轮换会话的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-it:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定国家（在此示例中为意大利）获取具有 30 分钟会话持续时间的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-it-sessionduration-30:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定国家（在此示例中为葡萄牙）获取具有会话 ID 的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-pt-session-randomstring123:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定城市（在此示例中为纽约市）获取具有会话 ID 的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-us-city-new_york-session-randomstring123:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定美国州（在此示例中为加利福尼亚州）获取 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-us-state-us_california:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定美国州（在此示例中为纽约州）获取 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-us-state-us_new_york:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 从特定美国州和城市（在此示例中为奥斯汀）获取具有会话 ID 和 30 分钟会话持续时间的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-us-state-us_texas-city-austin-session-randomstring123-sessionduration-30:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

##### 使用 ZIP 代码从特定美国位置（在此示例中为纽约）获取具有会话 ID 和 30 分钟会话持续时间的 IP

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-country-us-zip-10001-session-randomstring123-sessionduration-30:password" -x "gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

<Note>
  使用任何回连参数时，您的用户名也被视为参数之一。因此，您需要在指定用户名之前添加 `user-` 前缀，就像所有其他参数一样。
</Note>

***

<Columns cols={2}>
  <Card title="支持" href="https://direct.lc.chat/12092754" cta="让我们聊聊！">
    需要帮助或只是想打个招呼？我们的支持团队全天候为您服务。 \
    您也可以随时通过电子邮件 [support@decodo.com](mailto:support@decodo.com) 联系我们。
  </Card>

  <Card title="反馈" href="mailto:feedback@decodo.com" cta="分享反馈">
    找不到您要找的内容？请求一篇文章！ \
    有反馈意见？分享您对我们如何改进的想法。
  </Card>
</Columns>
