Skip to content

Commit abdf3b5

Browse files
committed
fix: httpx socks5 proxy
1 parent b045919 commit abdf3b5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/src/module/network/request_url.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,17 @@ def __exit__(self, exc_type, exc_val, exc_tb):
9191
self.session.close()
9292

9393
def _build_proxy_url(self):
94-
proxy_type = "http" if "http" in settings.proxy.type else "socks5h"
94+
if settings.proxy.type in ["http", "https", "socks5"]:
95+
proxy_type = settings.proxy.type
96+
else:
97+
proxy_type = None
9598
auth = (
9699
f"{settings.proxy.username}:{settings.proxy.password}@"
97100
if settings.proxy.username
98101
else ""
99102
)
100103

101-
if proxy_type not in ["http", "socks5h"]:
104+
if proxy_type is None:
102105
logger.error(f"[Network] Unsupported proxy type: {settings.proxy.type}")
103106
return None
104107

0 commit comments

Comments
 (0)