tailscale network

This commit is contained in:
2026-08-06 11:17:15 +08:00
parent 4df556a175
commit 81470ffea7
2 changed files with 10 additions and 7 deletions
+9 -6
View File
@@ -41,12 +41,15 @@ declare global {
}
// 这是登录表单首次显示时使用的本地默认地址;用户提交后的地址会保存到 localStorage。
// `0.0.0.0` is a server bind address, never a browser destination. When the
// Web Host is opened locally use loopback; when it is opened through the
// trusted Tailscale Host use the matching reachable AppServer address.
const DEFAULT_API = location.hostname === "127.0.0.1" || location.hostname === "localhost"
? "http://127.0.0.1:8090"
: "http://100.121.118.116:8090";
// `0.0.0.0` is a server bind address, never a browser destination.
// 打包后的 TauriAndroid + macOS)都通过 Tailscale 访问远程 AppServer
// 不能用 loopback(手机/沙盒里 127.0.0.1 指向自己),所以走 100.121.118.116。
// 仅浏览器本地 dev 模式(`http://127.0.0.1:1420` / `http://localhost:1420`)才回退到 loopback。
const DEFAULT_API = "__TAURI_INTERNALS__" in window
? "http://100.121.118.116:8090"
: location.hostname === "127.0.0.1" || location.hostname === "localhost"
? "http://127.0.0.1:8090"
: "http://100.121.118.116:8090";
// 这些状态对象属于当前可信 Host 的装配层:Runtime 负责会话、消息和可靠性,
// 它们负责将 Surface、Capability、Artifact 和执行进度投影到当前页面。