跳到內容

Context-Aware Routing

Context-Aware Routing 會自動為你的目標 URL 選擇最佳 IP 類型 —— residential、datacenter 或 dedicated —— 不需要手動設定。

類型最適用於速度成本
Residential電商、社群媒體、防爬蟲網站中等$$$
DatacenterAPI、無防護網站、大量請求$
Dedicated帳號管理、長時間 session中等$$

當你請求 proxy 時,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,session 型則使用 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%