mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
feat(proxy): add geo country routing to proxy urls
This commit is contained in:
parent
2265fcc513
commit
4fac1a20c3
3 changed files with 60 additions and 11 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue