Add support for more proxies (#3591)
Co-authored-by: Suchintan Singh <suchintan@skyvern.com>
This commit is contained in:
@@ -43,6 +43,12 @@ export const ProxyLocation = {
|
|||||||
ResidentialZA: "RESIDENTIAL_ZA",
|
ResidentialZA: "RESIDENTIAL_ZA",
|
||||||
ResidentialAR: "RESIDENTIAL_AR",
|
ResidentialAR: "RESIDENTIAL_AR",
|
||||||
ResidentialAU: "RESIDENTIAL_AU",
|
ResidentialAU: "RESIDENTIAL_AU",
|
||||||
|
ResidentialBR: "RESIDENTIAL_BR",
|
||||||
|
ResidentialTR: "RESIDENTIAL_TR",
|
||||||
|
ResidentialCA: "RESIDENTIAL_CA",
|
||||||
|
ResidentialMX: "RESIDENTIAL_MX",
|
||||||
|
ResidentialIT: "RESIDENTIAL_IT",
|
||||||
|
ResidentialNL: "RESIDENTIAL_NL",
|
||||||
ResidentialISP: "RESIDENTIAL_ISP",
|
ResidentialISP: "RESIDENTIAL_ISP",
|
||||||
None: "NONE",
|
None: "NONE",
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -30,6 +30,12 @@ function ProxySelector({ value, onChange, className }: Props) {
|
|||||||
<SelectItem value={ProxyLocation.ResidentialAU}>
|
<SelectItem value={ProxyLocation.ResidentialAU}>
|
||||||
Residential (Australia)
|
Residential (Australia)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
<SelectItem value={ProxyLocation.ResidentialBR}>
|
||||||
|
Residential (Brazil)
|
||||||
|
</SelectItem>
|
||||||
|
<SelectItem value={ProxyLocation.ResidentialCA}>
|
||||||
|
Residential (Canada)
|
||||||
|
</SelectItem>
|
||||||
<SelectItem value={ProxyLocation.ResidentialFR}>
|
<SelectItem value={ProxyLocation.ResidentialFR}>
|
||||||
Residential (France)
|
Residential (France)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
@@ -42,9 +48,18 @@ function ProxySelector({ value, onChange, className }: Props) {
|
|||||||
<SelectItem value={ProxyLocation.ResidentialIE}>
|
<SelectItem value={ProxyLocation.ResidentialIE}>
|
||||||
Residential (Ireland)
|
Residential (Ireland)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
<SelectItem value={ProxyLocation.ResidentialIT}>
|
||||||
|
Residential (Italy)
|
||||||
|
</SelectItem>
|
||||||
<SelectItem value={ProxyLocation.ResidentialJP}>
|
<SelectItem value={ProxyLocation.ResidentialJP}>
|
||||||
Residential (Japan)
|
Residential (Japan)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
<SelectItem value={ProxyLocation.ResidentialMX}>
|
||||||
|
Residential (Mexico)
|
||||||
|
</SelectItem>
|
||||||
|
<SelectItem value={ProxyLocation.ResidentialNL}>
|
||||||
|
Residential (Netherlands)
|
||||||
|
</SelectItem>
|
||||||
<SelectItem value={ProxyLocation.ResidentialNZ}>
|
<SelectItem value={ProxyLocation.ResidentialNZ}>
|
||||||
Residential (New Zealand)
|
Residential (New Zealand)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
@@ -54,6 +69,9 @@ function ProxySelector({ value, onChange, className }: Props) {
|
|||||||
<SelectItem value={ProxyLocation.ResidentialES}>
|
<SelectItem value={ProxyLocation.ResidentialES}>
|
||||||
Residential (Spain)
|
Residential (Spain)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
<SelectItem value={ProxyLocation.ResidentialTR}>
|
||||||
|
Residential (Turkey)
|
||||||
|
</SelectItem>
|
||||||
<SelectItem value={ProxyLocation.ResidentialGB}>
|
<SelectItem value={ProxyLocation.ResidentialGB}>
|
||||||
Residential (United Kingdom)
|
Residential (United Kingdom)
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ ProxyLocation = typing.Union[
|
|||||||
"RESIDENTIAL_ZA",
|
"RESIDENTIAL_ZA",
|
||||||
"RESIDENTIAL_AR",
|
"RESIDENTIAL_AR",
|
||||||
"RESIDENTIAL_AU",
|
"RESIDENTIAL_AU",
|
||||||
|
"RESIDENTIAL_BR",
|
||||||
|
"RESIDENTIAL_TR",
|
||||||
|
"RESIDENTIAL_CA",
|
||||||
|
"RESIDENTIAL_MX",
|
||||||
|
"RESIDENTIAL_IT",
|
||||||
|
"RESIDENTIAL_NL",
|
||||||
"RESIDENTIAL_ISP",
|
"RESIDENTIAL_ISP",
|
||||||
"NONE",
|
"NONE",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -2367,7 +2367,7 @@ async def new_debug_session(
|
|||||||
new_browser_session = await app.PERSISTENT_SESSIONS_MANAGER.create_session(
|
new_browser_session = await app.PERSISTENT_SESSIONS_MANAGER.create_session(
|
||||||
organization_id=current_org.organization_id,
|
organization_id=current_org.organization_id,
|
||||||
timeout_minutes=settings.DEBUG_SESSION_TIMEOUT_MINUTES,
|
timeout_minutes=settings.DEBUG_SESSION_TIMEOUT_MINUTES,
|
||||||
proxy_location=ProxyLocation.RESIDENTIAL_ISP,
|
proxy_location=ProxyLocation.RESIDENTIAL,
|
||||||
)
|
)
|
||||||
|
|
||||||
debug_session = await app.DATABASE.create_debug_session(
|
debug_session = await app.DATABASE.create_debug_session(
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ class ProxyLocation(StrEnum):
|
|||||||
RESIDENTIAL_ZA = "RESIDENTIAL_ZA"
|
RESIDENTIAL_ZA = "RESIDENTIAL_ZA"
|
||||||
RESIDENTIAL_AR = "RESIDENTIAL_AR"
|
RESIDENTIAL_AR = "RESIDENTIAL_AR"
|
||||||
RESIDENTIAL_AU = "RESIDENTIAL_AU"
|
RESIDENTIAL_AU = "RESIDENTIAL_AU"
|
||||||
|
RESIDENTIAL_BR = "RESIDENTIAL_BR"
|
||||||
|
RESIDENTIAL_TR = "RESIDENTIAL_TR"
|
||||||
|
RESIDENTIAL_CA = "RESIDENTIAL_CA"
|
||||||
|
RESIDENTIAL_MX = "RESIDENTIAL_MX"
|
||||||
|
RESIDENTIAL_IT = "RESIDENTIAL_IT"
|
||||||
|
RESIDENTIAL_NL = "RESIDENTIAL_NL"
|
||||||
RESIDENTIAL_ISP = "RESIDENTIAL_ISP"
|
RESIDENTIAL_ISP = "RESIDENTIAL_ISP"
|
||||||
NONE = "NONE"
|
NONE = "NONE"
|
||||||
|
|
||||||
@@ -83,6 +89,12 @@ class ProxyLocation(StrEnum):
|
|||||||
cls.RESIDENTIAL_ZA,
|
cls.RESIDENTIAL_ZA,
|
||||||
cls.RESIDENTIAL_AR,
|
cls.RESIDENTIAL_AR,
|
||||||
cls.RESIDENTIAL_AU,
|
cls.RESIDENTIAL_AU,
|
||||||
|
cls.RESIDENTIAL_BR,
|
||||||
|
cls.RESIDENTIAL_TR,
|
||||||
|
cls.RESIDENTIAL_CA,
|
||||||
|
cls.RESIDENTIAL_MX,
|
||||||
|
cls.RESIDENTIAL_IT,
|
||||||
|
cls.RESIDENTIAL_NL,
|
||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -100,6 +112,12 @@ class ProxyLocation(StrEnum):
|
|||||||
ProxyLocation.RESIDENTIAL_ZA: 2000,
|
ProxyLocation.RESIDENTIAL_ZA: 2000,
|
||||||
ProxyLocation.RESIDENTIAL_AR: 2000,
|
ProxyLocation.RESIDENTIAL_AR: 2000,
|
||||||
ProxyLocation.RESIDENTIAL_AU: 2000,
|
ProxyLocation.RESIDENTIAL_AU: 2000,
|
||||||
|
ProxyLocation.RESIDENTIAL_BR: 2000,
|
||||||
|
ProxyLocation.RESIDENTIAL_TR: 2000,
|
||||||
|
ProxyLocation.RESIDENTIAL_CA: 2000,
|
||||||
|
ProxyLocation.RESIDENTIAL_MX: 2000,
|
||||||
|
ProxyLocation.RESIDENTIAL_IT: 2000,
|
||||||
|
ProxyLocation.RESIDENTIAL_NL: 2000,
|
||||||
}
|
}
|
||||||
return counts.get(proxy_location, 10000)
|
return counts.get(proxy_location, 10000)
|
||||||
|
|
||||||
@@ -118,6 +136,12 @@ class ProxyLocation(StrEnum):
|
|||||||
ProxyLocation.RESIDENTIAL_ZA: "ZA",
|
ProxyLocation.RESIDENTIAL_ZA: "ZA",
|
||||||
ProxyLocation.RESIDENTIAL_AR: "AR",
|
ProxyLocation.RESIDENTIAL_AR: "AR",
|
||||||
ProxyLocation.RESIDENTIAL_AU: "AU",
|
ProxyLocation.RESIDENTIAL_AU: "AU",
|
||||||
|
ProxyLocation.RESIDENTIAL_BR: "BR",
|
||||||
|
ProxyLocation.RESIDENTIAL_TR: "TR",
|
||||||
|
ProxyLocation.RESIDENTIAL_CA: "CA",
|
||||||
|
ProxyLocation.RESIDENTIAL_MX: "MX",
|
||||||
|
ProxyLocation.RESIDENTIAL_IT: "IT",
|
||||||
|
ProxyLocation.RESIDENTIAL_NL: "NL",
|
||||||
}
|
}
|
||||||
return mapping.get(proxy_location, "US")
|
return mapping.get(proxy_location, "US")
|
||||||
|
|
||||||
@@ -177,6 +201,24 @@ def get_tzinfo_from_proxy(proxy_location: ProxyLocation) -> ZoneInfo | None:
|
|||||||
if proxy_location == ProxyLocation.RESIDENTIAL_AU:
|
if proxy_location == ProxyLocation.RESIDENTIAL_AU:
|
||||||
return ZoneInfo("Australia/Sydney")
|
return ZoneInfo("Australia/Sydney")
|
||||||
|
|
||||||
|
if proxy_location == ProxyLocation.RESIDENTIAL_BR:
|
||||||
|
return ZoneInfo("America/Sao_Paulo")
|
||||||
|
|
||||||
|
if proxy_location == ProxyLocation.RESIDENTIAL_TR:
|
||||||
|
return ZoneInfo("Europe/Istanbul")
|
||||||
|
|
||||||
|
if proxy_location == ProxyLocation.RESIDENTIAL_CA:
|
||||||
|
return ZoneInfo("America/Toronto")
|
||||||
|
|
||||||
|
if proxy_location == ProxyLocation.RESIDENTIAL_MX:
|
||||||
|
return ZoneInfo("America/Mexico_City")
|
||||||
|
|
||||||
|
if proxy_location == ProxyLocation.RESIDENTIAL_IT:
|
||||||
|
return ZoneInfo("Europe/Rome")
|
||||||
|
|
||||||
|
if proxy_location == ProxyLocation.RESIDENTIAL_NL:
|
||||||
|
return ZoneInfo("Europe/Amsterdam")
|
||||||
|
|
||||||
if proxy_location == ProxyLocation.RESIDENTIAL_ISP:
|
if proxy_location == ProxyLocation.RESIDENTIAL_ISP:
|
||||||
return ZoneInfo("America/New_York")
|
return ZoneInfo("America/New_York")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user