diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-21 07:45:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-21 07:45:23 +0200 |
commit | 0f3935f1c068c723342153dd040e0e72e95aa11b (patch) | |
tree | c4d1e9c9eb2ebfe13e2679afe8a23d7ffa45fa46 /g4f/requests/aiohttp.py | |
parent | Merge pull request #1865 from hlohaus/carst (diff) | |
parent | Add MissingRequirementsError to You (diff) | |
download | gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.gz gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.bz2 gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.lz gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.xz gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.zst gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.zip |
Diffstat (limited to 'g4f/requests/aiohttp.py')
-rw-r--r-- | g4f/requests/aiohttp.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g4f/requests/aiohttp.py b/g4f/requests/aiohttp.py index cdbedef3..4b629963 100644 --- a/g4f/requests/aiohttp.py +++ b/g4f/requests/aiohttp.py @@ -24,6 +24,7 @@ class StreamSession(ClientSession): headers: dict = {}, timeout: int = None, connector: BaseConnector = None, + proxy: str = None, proxies: dict = {}, impersonate = None, **kwargs @@ -38,11 +39,13 @@ class StreamSession(ClientSession): connect, timeout = timeout; if timeout is not None: timeout = ClientTimeout(timeout, connect) + if proxy is None: + proxy = proxies.get("all", proxies.get("https")) super().__init__( **kwargs, timeout=timeout, response_class=StreamResponse, - connector=get_connector(connector, proxies.get("all", proxies.get("https"))), + connector=get_connector(connector, proxy), headers=headers ) |