Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

fix(linux): a server on the local network that can't be reached no longer gets advice to turn on a proxy

wquguru1c4c5d011c8f
diff --git a/linux/cicada/app/aicheck_view.py b/linux/cicada/app/aicheck_view.py
index ea36b18..2c2c1b8 100644
--- a/linux/cicada/app/aicheck_view.py
+++ b/linux/cicada/app/aicheck_view.py
@@ -6,6 +6,7 @@ from __future__ import annotations
from gi.repository import Gtk
from ..core import aicheck
+from ..core.providers import is_nearby
from ..core import strings
from ..core.strings import L, LF
from . import ui
@@ -39,6 +40,9 @@ def actions(app, change_key, recheck_in_step: bool = True) -> list:
reason = f[1]
recheck = [(L("重新检查"), app.recheck)] if recheck_in_step else []
if reason == aicheck.UNREACHABLE:
+ # A proxy has nothing to do with a server on this computer or the local network.
+ if is_nearby(ling.service_host):
+ return recheck
return [(L("怎么设置代理"), lambda: open_uri(aicheck.help_url(strings.language)))] + recheck
if reason in (aicheck.INVALID_KEY, aicheck.MGMT_KEY):
out = [(L("更换 key"), change_key)]
diff --git a/linux/cicada/core/aicheck.py b/linux/cicada/core/aicheck.py
index 2994e75..d9b7ff1 100644
--- a/linux/cicada/core/aicheck.py
+++ b/linux/cicada/core/aicheck.py
@@ -192,7 +192,9 @@ class AICheck:
def proxy_line(self, service: str, host: str) -> str | None:
"""Under "can't reach": what this computer's proxy looks like, and what to do."""
- if self.reason != UNREACHABLE or self.proxy is None:
+ from .providers import is_nearby
+ # A server on this computer or the local network: a proxy has nothing to do with it.
+ if self.reason != UNREACHABLE or self.proxy is None or is_nearby(host):
return None
if self.proxy[0] == "system":
return LF("开了代理也连不上:换一个节点,或检查代理软件是否放过 %@。", host)