mirror of
https://github.com/etienne-hd/lbc.git
synced 2026-04-10 01:25:35 +02:00
add optional scheme from proxy dataclass
This commit is contained in:
@@ -7,10 +7,11 @@ class Proxy:
|
||||
port: Union[str, int]
|
||||
username: Optional[str] = None
|
||||
password: Optional[str] = None
|
||||
scheme: Optional[str] = "http"
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
if self.username and self.password:
|
||||
return f"http://{self.username}:{self.password}@{self.host}:{self.port}"
|
||||
return f"{self.scheme}://{self.username}:{self.password}@{self.host}:{self.port}"
|
||||
else:
|
||||
return f"http://{self.host}:{self.port}"
|
||||
return f"{self.scheme}://{self.host}:{self.port}"
|
||||
Reference in New Issue
Block a user