Context-Aware Routing
Context-Aware Routing
Section titled “Context-Aware Routing”Context-Aware Routing 會自動為你的目標 URL 選擇最佳 IP 類型 —— residential、datacenter 或 dedicated —— 不需要手動設定。
| 類型 | 最適用於 | 速度 | 成本 |
|---|---|---|---|
| Residential | 電商、社群媒體、防爬蟲網站 | 中等 | $$$ |
| Datacenter | API、無防護網站、大量請求 | 快 | $ |
| Dedicated | 帳號管理、長時間 session | 中等 | $$ |
路由如何運作
Section titled “路由如何運作”當你請求 proxy 時,HydraSkill 會分析目標:
# HydraSkill 自動為 Amazon 選擇 residentialproxy = client.get_proxy(target="amazon.com")print(proxy.type) # "residential"
# 為公開 API 選擇 datacenterproxy = client.get_proxy(target="api.github.com")print(proxy.type) # "datacenter"路由引擎會考量:
- 目標網域信譽 —— 已知的防爬蟲系統會配給 residential IP
- 歷史封鎖率 —— 經常封鎖的網域會取得高階 IP
- 請求樣式 —— 高頻請求使用 datacenter,session 型則使用 residential
- 地理需求 —— 某些地區的 residential 覆蓋率較佳
你隨時可以手動指定 IP 類型:
# 即使是 API 也強制使用 residentialproxy = client.get_proxy( target="api.example.com", ip_type="residential")
# 為了速度強制使用 datacenterproxy = client.get_proxy( target="amazon.com", ip_type="datacenter" # 較便宜但封鎖風險較高)路由規則(Enterprise)
Section titled “路由規則(Enterprise)”Enterprise 方案可以定義自訂路由規則:
routing_rules: - match: "*.amazon.*" ip_type: residential country: auto # 配合目標地區 - match: "api.*" ip_type: datacenter - match: "*.google.com" ip_type: residential rotate_every: 10 # 每 10 個請求換一個新 IPContext-Aware Routing 預設就能省錢 —— 只有在必要時才使用昂貴的 residential IP。對於沒有防爬蟲保護的目標,它會自動透過較便宜的 datacenter IP 路由。
典型節省幅度:相較於一律使用 residential 可省 30-50%。