diff --git a/core/config_sync.py b/core/config_sync.py index e20d02d..8db730e 100644 --- a/core/config_sync.py +++ b/core/config_sync.py @@ -16,6 +16,10 @@ import logging import os import platform import socket + +# 禁用系统代理(Clash 等代理工具会干扰 Redis TCP 长连接) +for key in ("http_proxy", "https_proxy", "HTTP_PROXY", "HTTPS_PROXY", "all_proxy", "ALL_PROXY"): + os.environ.pop(key, None) import threading import time from datetime import datetime diff --git a/main.py b/main.py index c4dd923..989b727 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,10 @@ import time from datetime import datetime from typing import Dict, Any, Optional, List, Tuple +# 禁用系统代理(Clash 等代理工具会干扰 Redis TCP 长连接和 HTTP 请求) +for _key in ("http_proxy", "https_proxy", "HTTP_PROXY", "HTTPS_PROXY", "all_proxy", "ALL_PROXY"): + os.environ.pop(_key, None) + from config.settings import get_settings, Settings from core.config_sync import get_config_sync_manager, ConfigSyncManager from core.debug_http_server import start_debug_http_server