From 79a7bac963be4be65751c606f987483f136126b4 Mon Sep 17 00:00:00 2001 From: codeking Date: Tue, 18 Nov 2025 06:44:57 +0100 Subject: [PATCH] Improve connection status determination logic --- core/controllers/ConnectionController.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/core/controllers/ConnectionController.py b/core/controllers/ConnectionController.py index a1d5a85..f6e4dcc 100644 --- a/core/controllers/ConnectionController.py +++ b/core/controllers/ConnectionController.py @@ -405,13 +405,27 @@ class ConnectionController: timeout = float(timeout) proxies = None + request_urls = [ + Constants.PING_URL, + 'https://hc1.simplifiedprivacy.net', + 'https://hc2.simplifiedprivacy.org', + 'https://hc3.hydraveil.net' + ] + if port_number is not None: proxies = ConnectionController.get_proxies(port_number) - try: - requests.get(Constants.PING_URL, timeout=timeout, proxies=proxies) - except requests.exceptions.RequestException: - raise ConnectionError('The connection could not be established.') + for request_url in request_urls: + + try: + + requests.get(request_url, timeout=timeout, proxies=proxies) + return None + + except requests.exceptions.RequestException: + pass + + raise ConnectionError('The connection could not be established.') @staticmethod def __should_renegotiate(profile: Union[SessionProfile, SystemProfile]):