diff --git a/pythonlib/camoufox/ip.py b/pythonlib/camoufox/ip.py index cca4ac6..0a09ae5 100644 --- a/pythonlib/camoufox/ip.py +++ b/pythonlib/camoufox/ip.py @@ -30,13 +30,15 @@ class Proxy: """ Parses the proxy server string. """ - proxy_match = re.match(r'^(?P\w+)://(?P.*?)(?:\:(?P\d+))?$', server) + proxy_match = re.match(r'^(?:(?P\w+)://)?(?P.*?)(?:\:(?P\d+))?$', server) if not proxy_match: raise InvalidProxy(f"Invalid proxy server: {server}") return proxy_match['schema'], proxy_match['url'], proxy_match['port'] def as_string(self) -> str: schema, url, port = self.parse_server(self.server) + if not schema: + schema = 'http' result = f"{schema}://" if self.username: result += f"{self.username}" diff --git a/pythonlib/pyproject.toml b/pythonlib/pyproject.toml index 14381ba..277178f 100644 --- a/pythonlib/pyproject.toml +++ b/pythonlib/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "camoufox" -version = "0.3.3" +version = "0.3.4" description = "Wrapper around Playwright to help launch Camoufox" authors = ["daijro "] license = "MIT"