From 57220c93db2eaae5731a7484234f47ad88b43bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=BE=AAAkimio?= Date: Thu, 6 Aug 2026 15:08:29 +0800 Subject: [PATCH] fix(checks): update regex for proxy string to support socks proxy (#6236) --- app/doctor/checks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/doctor/checks.py b/app/doctor/checks.py index 6f0607f93..6da2d9a96 100644 --- a/app/doctor/checks.py +++ b/app/doctor/checks.py @@ -430,13 +430,13 @@ def _check_config(runner: DoctorRunnerProtocol) -> None: ) proxy_host = (settings.PROXY_HOST or "").strip() - if proxy_host and not re.match(r"^https?://", proxy_host, re.IGNORECASE): + if proxy_host and not re.match(r"^(https?|socks5h?)://", proxy_host, re.IGNORECASE): runner.add( finding_id="config.proxy_format", severity=DoctorSeverity.Warn, status=DoctorFindingStatus.Degraded, title="代理地址格式可能不完整", - detail=f"PROXY_HOST={proxy_host} 未包含 http:// 或 https:// 前缀。", + detail=f"PROXY_HOST={proxy_host} 未包含 http:// 或 https:// 或 socks5:// 或 socks5h:// 前缀。", recommendation="如果外部访问异常,请把 PROXY_HOST 调整为完整 URL。", )