summaryrefslogtreecommitdiffstats
path: root/g4f/providers
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-26 10:59:18 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-26 10:59:18 +0100
commit02b84fb519c853cee0a7765b475371d9eb59cf60 (patch)
tree3035374d3110f0a9d09a6aa59a7043076dc90a0a /g4f/providers
parentFix GeminiPro auth for normal user (diff)
downloadgpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar
gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.gz
gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.bz2
gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.lz
gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.xz
gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.zst
gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.zip
Diffstat (limited to 'g4f/providers')
-rw-r--r--g4f/providers/helper.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/g4f/providers/helper.py b/g4f/providers/helper.py
index 49d033d1..6981f984 100644
--- a/g4f/providers/helper.py
+++ b/g4f/providers/helper.py
@@ -55,7 +55,11 @@ def get_connector(connector: BaseConnector = None, proxy: str = None) -> Optiona
if proxy and not connector:
try:
from aiohttp_socks import ProxyConnector
- connector = ProxyConnector.from_url(proxy)
+ rdns = False
+ if proxy.startswith("socks5h://"):
+ proxy = proxy.replace("socks5h://", "socks5://")
+ rdns = True
+ connector = ProxyConnector.from_url(proxy, rdns=rdns)
except ImportError:
raise MissingRequirementsError('Install "aiohttp_socks" package for proxy support')
return connector \ No newline at end of file