feat(proxy): add geo country routing to proxy urls

This commit is contained in:
Anish Sarkar 2026-07-15 15:31:38 +05:30
parent 2265fcc513
commit 4fac1a20c3
3 changed files with 60 additions and 11 deletions

View file

@ -15,9 +15,16 @@ def get_proxy_url() -> str | None:
return get_active_provider().get_proxy_url()
def get_sticky_proxy_url(session_id: str) -> str | None:
def get_geo_proxy_url(country: str | None = None) -> str | None:
"""Proxy URL pinned to an exit country when the provider supports it."""
return get_active_provider().get_geo_proxy_url(country)
def get_sticky_proxy_url(
session_id: str, country: str | None = None
) -> str | None:
"""Proxy URL pinned to a stable vendor session when supported."""
return get_active_provider().get_sticky_proxy_url(session_id)
return get_active_provider().get_sticky_proxy_url(session_id, country)
def get_playwright_proxy() -> dict[str, str] | None:
@ -46,6 +53,7 @@ def get_residential_proxy_url() -> str | None:
__all__ = [
"ProxyProvider",
"get_active_provider",
"get_geo_proxy_url",
"get_playwright_proxy",
"get_proxy_url",
"get_requests_proxies",