From 144fad29c23908200fabb9b3a380f66197717d07 Mon Sep 17 00:00:00 2001 From: yuming Date: Sat, 25 Apr 2026 22:38:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20SOCKS5=20=E6=B5=8B=E8=AF=95=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20socks5h=20=E9=81=BF=E5=85=8D=20DNS=20=E6=B1=A1?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/web.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/web.py b/module/web.py index 22e18e6..f59e929 100644 --- a/module/web.py +++ b/module/web.py @@ -1063,7 +1063,9 @@ def api_test_proxy(): except (ValueError, TypeError): return jsonify({"success": False, "error": "端口号必须是数字"}) - proxy_url = f"{scheme}://{hostname}:{port}" + # SOCKS5 强制使用 socks5h,由代理服务器解析 DNS,避免国内 DNS 污染导致测试失败 + test_scheme = "socks5h" if scheme == "socks5" else scheme + proxy_url = f"{test_scheme}://{hostname}:{port}" proxies = {"http": proxy_url, "https": proxy_url} try: