代理配置选项
代理网络访问
有两种方式可以访问Bright Data的代理网络:本机和通过REST API。详细阅读本文以决定哪种方式最适合您:代理API身份验证: https://docs.brightdata.com/api-reference/proxy/proxy_api_auth
通过代理用户名和密码进行本机访问
创建Bright Data代理区域(包含产品及其配置设置)后,您将收到代理用户名和密码。
代理用户名包含您的账户ID、区域名称和可选参数。
代理用户名结构为:
请注意,区域名称创建后就无法更改。如果需要更改区域名称,请创建一个新区域(您可以将代理在同类型的区域之间转移)。
本页面介绍通过添加可选参数和修改用户名,您如何可以利用代码以非常精细的方式控制Bright Data系统。下表列出了开发者可以在代理用户名中使用的所有选项。 详细列表可参见我们的API参考文档:
使用API令牌访问
API令牌可用于访问代理网络。 有些用户可能会发现API令牌使用起来更方便。 API令牌让您可以:
-
使用一个令牌控制访问,不需要结合使用两个令牌
-
令牌与用户名绑定,增强了可追溯性
-
访问所有区域的令牌
-
更容易迁移到适用于难访问域的高级抓取解决方案
-
完全符合REST API
创建API令牌
请参阅我们的API令牌及其使用方法: https://docs.brightdata.com/cn/general/account/api-token
与第三方和工具集成
您可以使用控制面板上的代理集成示例页面来创建不同的请求。
代理定位选项
这些设置让您可以轻松地为特定国家/地区、州、城市、邮政编码和ASN配置代理。
参数 | 描述 | 用户名示例 |
---|---|---|
-country-xx | 通过双字母代码选择一个国家/地区,或者选择eu代表欧盟的任意国家/地区。国家/地区代码列表位于此处 here | brd-customer-<customer_id>-zone-<zone_name>-country-us |
-state-xxxxx | 通过双字母代码定位美国境内的一个州。 必须包含国家名称US。 | brd-customer-<customer_id>-zone-<zone_name>-country-us-state-ny |
-city-xxxxx | 定位城市。 必须包含国家/地区(例如username-country-fr-city-paris)。 不要使用空格(例如-city-sanfrancisco) | brd-customer-<customer_id>-zone-<zone_name>-country-us-city-sanfrancisco |
-zip-xxxxx | 定位美国邮政编码。 使用5位数的邮政编码 | brd-customer-<customer_id>-zone-<zone_name>-city-memphis-zip-37501 |
-asn-xxxxx | 定位列表中的一个ASN the list | brd-customer-<customer_id>-zone-<zone_name>-asn-56386 |
-os-xxxxx | 仅适用于住宅代理。 允许针对 Windows 、MacOS 或 android | brd-customer-<customer_id>-zone-<zone_name>-os-windows |
-carrier-os-xxxxx | 仅适用于移动代理,您可以选择使用此列表中的特定运营商 this list | brd-customer-<customer_id>-zone-<zone_name>-carrier-dt |
控制代理’ DNS
The following option allows you to set how DNS resolution is performed.
功能 | 参数 | 描述 | 用户名示例 |
---|---|---|---|
选择DNS解析位置 | -dns-local or -dns-remote | Lets you choose if DNS is resolved remote on the proxy connecting to the site, or local on Bright Data’s servers (‘Super Proxies’). More info here | brd-customer-<customer_id>-zone-<zone_name>-dns-local |
控制代理 rotation
The following options allow you to set how we rotate within the proxies in the zone, or attach to a specific proxy, and what shall we do if the peer is not available from some reason. For more information regarding the way IP rotation works with our proxy products, and for further explanation of the following options, please see this article
功能 | 参数 | 描述 | 用户名示例 |
---|---|---|---|
为多个请求保持相同的IP或轮换IP | -session-xxxxxx | 每个唯一的会话ID都会获得一个唯一的IP,可以用于反复定位同一个IP,也可以强制轮换。 建议实施有计划的IP轮换。 | brd-customer-<customer_id>-zone-<zone_name>-session-mystring12345 |
选择特定IP | -ip-x.x.x.x | 仅适用于已分配专用IP的区域 | brd-customer-<customer_id>-zone-<zone_name>-ip-1.2.3.4 |
选择特定IP组(gIP) | -gip-xxxxxx | 仅适用于专用的住宅或移动代理。 | brd-customer-<customer_id>-zone-<zone_name>-gip-us_7922_fl_hollywood_0 |
跟踪单个响应 | -c_tag-xxxxxx | 在请求中包含一个唯一的 c_tag 标记。响应时,企业会在标头中回显相同的标记。 这种无缝交换可确保每个响应都与相应的请求绑定,从而消除混乱,并简化了数据管理。 | brd-customer-<customer_id>-zone-<zone_name>-c_tag-<C_TAG_VALUE> |
在会话中绑定到对等节点 | -const | 使用同一个对等节点进行会话。如果对等节点不可用,则将返回502错误:“无可用的对等节点” | brd-customer-<customer_id>-zone-<zone_name>-const |
控制“超级代理”
超级代理是负责将您的请求路由到实际代理(这些代理可以是数据中心、ISP或住宅代理)的主服务器。 注意:这些参数很少需要修改!
功能 | 参数 | 描述 | 用户名示例 | |
---|---|---|---|---|
直接从超级代理发送请求 | -direct | 为多个请求保持相同的IP。 每个唯一的会话ID都会获得一个唯一的IP。 | brd-customer-<customer_id>-zone-<zone_name>-direct | |
选择特定国家/地区的超级代理 | session-xxxxxx | 仅适用于选择超级代理(很少需要进行此操作)。 More details here | 示例 | |
选择特定IP组(gIP) | gip-xxxxxx | 仅适用于专用的住宅或移动代理。 | brd-customer-<customer_id>-zone-<zone_name>-gip-us_7922_fl_hollywood_0 | 您好, |
此页面对您有帮助吗?