跳转到内容

Context-Aware Routing

Context-Aware Routing 会为你的目标 URL 自动选择最佳 IP 类型 —— residential、datacenter 或 dedicated —— 无需手动配置。

类型最适合速度成本
Residential电商、社交媒体、反爬站点中等$$$
DatacenterAPI、无防护站点、批量请求$
Dedicated账户管理、长会话中等$$

当你请求代理时,HydraSkill 会分析目标:

# HydraSkill 自动为 Amazon 选择 residential
proxy = client.get_proxy(target="amazon.com")
print(proxy.type) # "residential"
# 为公开 API 选择 datacenter
proxy = client.get_proxy(target="api.github.com")
print(proxy.type) # "datacenter"

路由引擎会考虑:

  1. 目标域名信誉 —— 已知的反爬系统会分配 residential IP
  2. 历史封锁率 —— 频繁封锁的域名会分配高级 IP
  3. 请求模式 —— 高频请求分配 datacenter,基于会话的分配 residential
  4. 地理需求 —— 某些地区的 residential 覆盖更好

你随时可以手动指定 IP 类型:

# 即使是 API 也强制使用 residential
proxy = client.get_proxy(
target="api.example.com",
ip_type="residential"
)
# 为追求速度强制使用 datacenter
proxy = client.get_proxy(
target="amazon.com",
ip_type="datacenter" # 更便宜,但封锁风险更高
)

Enterprise 套餐可以定义自定义路由规则:

.hydraskill.yml
routing_rules:
- match: "*.amazon.*"
ip_type: residential
country: auto # 匹配目标所在地区
- match: "api.*"
ip_type: datacenter
- match: "*.google.com"
ip_type: residential
rotate_every: 10 # 每 10 个请求换一个新 IP

Context-Aware Routing 默认就能省钱 —— 只在需要时才使用昂贵的 residential IP。对于没有反爬防护的目标,它会自动通过更便宜的 datacenter IP 路由。

典型节省:相比始终使用 residential 可节省 30-50%