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

# 白名单IP请求

> 通过白名单IP身份验证使用移动代理高级参数

要验证您的代理连接，您可以使用白名单IP而不是用户名和密码。为此，您需要直接在**端点**中指定所有代理参数。

了解如何添加白名单IP [****请点击这里****](https://help.decodo.com/docs/cn/mobile-proxy-authentication-methods#managing-whitelisted-ips)。

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

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

***

## 国家定位

如果需要来自特定国家的IP，则修改**端点**以包含`country-xx`参数。使用两个字母的Alpha-2代码。完整列表请参见[**这里**](https://www.iban.com/country-codes)。

返回美国IP的**轮换代理**示例：

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

来自意大利的**轮换**IP：

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

***

## 城市定位

在端点中添加`city-xxxx`参数以指定国家内的城市。

它与`country`参数结合使用，不能单独使用。

如果城市名称由多个单词组成，则使用下划线。

返回纽约市IP的**轮换代理**示例：

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

返回罗马IP的**轮换代理**示例：

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

***

## 州定位

在端点中添加`state-us_xxxxx`将允许州定位。目前仅支持美国各州。

返回纽约州IP的**轮换代理**示例：

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

来自加利福尼亚州的**轮换**IP：

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

***

## 大陆定位

在端点中添加`continent`参数将允许您定位来自特定大陆的IP。

返回欧洲IP的**轮换代理**示例：

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

<Note>
  ### 大陆代码

  * 亚洲 – `as`
  * 非洲 – `af`
  * 欧洲 – `eu`
  * 北美洲 – `na`
  * 大洋洲 – `oc`
  * 南美洲 – `sa`
</Note>

***

## ASN定位

添加`asn`参数将允许您定位来自特定运营商的IP。

* 您必须在`city`定位和`asn`定位之间选择，因为它们不能同时使用。
  * 相同的逻辑也适用于`continent`、`state`和`country`参数。
* 使用**AT\&T Mobility LLC** `asn`号码的轮换会话代理示例：

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

<Note>
  ### 运营商号码

  您可以通过在线搜索查找运营商号码，例如[**这里**](https://asnlookup.com/)。
</Note>

***

## 粘性会话

上述示例使用轮换会话执行，因此每次请求都会获得新的IP地址。在端点中添加`session`变量将允许IP地址在多个请求中保持不变。

返回美国IP地址的**粘性**会话示例：

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

由于此代理是**粘性**的，如果再次运行该命令，将返回相同的IP地址，因为该IP地址仍有活动会话。

**默认**会话持续时间为**10分钟**。之后IP地址将自动轮换。

必须有一种方法来区分分配给用户的每个会话，因为可以同时拥有多个活动粘性会话。

<Info>
  ### 会话值

  上面的示例中使用了值 – `randomstring123`。可以根据您的偏好使用任何字母数字文本/字符串。以下所有这些都是可行的：

  `session-random123`、`session-1`、`session-abcdef`、`session-2`等。
</Info>

不同的会话参数值用于区分活动会话，其行为就像我们国家端点的不同**粘性代理**端口一样。

例如，如果您使用会话变量`randomstring123`运行上述命令，您会看到即使调整其他参数（如国家、城市等），相同的代理IP仍然保持不变。

这意味着如果您需要更改位置或更快地轮换代理IP，也必须更改会话参数。否则，IP地址将不会轮换。

<Note>
  ### 使用端口维护会话

  或者，您可以使用端口而不是`session`参数。例如：

  * `country-us-sessionduration-60.gate.decodo.com:10001`；
  * `country-us-sessionduration-60.gate.decodo.com:10002`；
  * `country-us-sessionduration-60.gate.decodo.com:10003`。

  可用端口范围为`10001`-`49999`。
</Note>

***

## 会话持续时间

在端点中添加`sessionduration-x`将允许会话持续最多**24小时**。

<Note>
  ### 会话长度

  接受**1**到**1440**之间的任何整数。

  例如：`sessionduration-1` `sessionduration-10` `sessionduration-600`
</Note>

<Warning>
  ### 过早轮换

  会话时间越长，由于末端的住宅设备离线，**IP在您指定的时间之前轮换**的可能性就越大。
</Warning>

***

来自芝加哥的**粘性**IP示例，将持续最多90分钟：

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us-city-chicago-session-example1-sessionduration-90.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

来自卡萨布兰卡的**粘性**IP示例，将持续最多1分钟：

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-ma-city-casablanca-session-example2-sessionduration-1.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

<Note>
  ### 注意

  使用**回连**时，我们无法保证IP可用性，特别是在定位较小的国家或城市时。
</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>
