summaryrefslogtreecommitdiffstats
path: root/g4f/requests/aiohttp.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-21 07:22:59 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-21 07:22:59 +0200
commitdb2d6cffd9268e8842f0c2aa8e062c0e19d88d28 (patch)
tree2b44e3ec6e21a8c1270f3d84a4a1f0efb360d37b /g4f/requests/aiohttp.py
parentDisable Bing integration test (diff)
downloadgpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.gz
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.bz2
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.lz
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.xz
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.tar.zst
gpt4free-db2d6cffd9268e8842f0c2aa8e062c0e19d88d28.zip
Diffstat (limited to 'g4f/requests/aiohttp.py')
-rw-r--r--g4f/requests/aiohttp.py5
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
)