fix: SOCKS5 测试改用 socks5h 避免 DNS 污染
部署到群晖 / deploy (push) Successful in 51s

This commit is contained in:
yuming
2026-04-25 22:38:34 +08:00
parent eb454cbe73
commit 144fad29c2
+3 -1
View File
@@ -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: