dsh-remote-web 0.7.6-beta.4 → 0.7.6-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/runtime/dsh-setup.mjs +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-web",
|
|
3
|
-
"version": "0.7.6-beta.
|
|
3
|
+
"version": "0.7.6-beta.5",
|
|
4
4
|
"description": "公网远程控制 DeepSeek Harness(dsh web):安装即得专属加密地址,人在外面也能用手机访问电脑上的 dsh——无需同一局域网/WiFi、无需公网 IP 与内网穿透,全程加密;手机端 100% 还原电脑体验(对话/工具/审批/设置)。技术用户可选自建服务,流量走自己的服务器。Remote control DeepSeek Harness (dsh web) from anywhere over the public internet — install, get an encrypted URL, use it from your phone on any network (dual-half cordis plugin: Settings panel + same-origin /dsh-remote routes). (2026-09 由 dsh-remote-ui 更名 / renamed from dsh-remote-ui; dsh-remote 的 dsh web 插件半,不是纯 UI/皮肤插件)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
package/runtime/dsh-setup.mjs
CHANGED
|
@@ -1223,6 +1223,18 @@ async function upstreamReachable(url = upstreamUrl(), timeoutMs = 1200) {
|
|
|
1223
1223
|
*/
|
|
1224
1224
|
async function isDshWebUp(timeoutMs = 1200) {
|
|
1225
1225
|
if (await upstreamReachable(upstreamUrl(), timeoutMs)) return true;
|
|
1226
|
+
// 🔴 2026-10-25(设备掉线实测):Electron 每次启动可能换端口。端口文件由 dsh web 内的插件
|
|
1227
|
+
// 在每次启动时重写,比进程内的 discoveredUpstream 缓存新 —— 先直接试文件,别被旧缓存挡住。
|
|
1228
|
+
try {
|
|
1229
|
+
const fromFile = String(fs.readFileSync(path.join(CONFIG_DIR, UPSTREAM_FILE), "utf8")).trim();
|
|
1230
|
+
if (/^https?:\/\/[^\s]+$/i.test(fromFile)) {
|
|
1231
|
+
const normalized = fromFile.replace(/\/+$/, "");
|
|
1232
|
+
if (normalized !== upstreamUrl() && (await upstreamReachable(normalized, timeoutMs))) {
|
|
1233
|
+
discoveredUpstream = normalized;
|
|
1234
|
+
return true;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
} catch { /* 没有端口文件:继续走动态发现 */ }
|
|
1226
1238
|
const before = upstreamUrl();
|
|
1227
1239
|
const after = await refreshUpstreamDiscovery(true);
|
|
1228
1240
|
if (after === before) return false;
|
|
@@ -1859,6 +1871,9 @@ async function runBridge() {
|
|
|
1859
1871
|
const alive = await checkUpstream();
|
|
1860
1872
|
if (alive && childStopped(bridgeProc)) {
|
|
1861
1873
|
starting = true;
|
|
1874
|
+
// dsh 重启可能换端口(Electron 每次启动端口可能变):拉起前**强制重新发现**,
|
|
1875
|
+
// 否则 discoveredUpstream 缓存旧端口 → bridge 连不上上游 → 设备掉线(2026-10-25 实测)。
|
|
1876
|
+
await refreshUpstreamDiscovery(true);
|
|
1862
1877
|
console.log("[dsh-remote] dsh web 在线,启动 bridge...");
|
|
1863
1878
|
// 清除代理环境变量(bridge 需直连 relay,不受本机代理影响)
|
|
1864
1879
|
const childEnv = {
|
|
@@ -1913,6 +1928,8 @@ async function runBridge() {
|
|
|
1913
1928
|
setTimeout(() => { starting = false; }, 5000);
|
|
1914
1929
|
} else if (!alive && bridgeProc && bridgeProc.exitCode === null) {
|
|
1915
1930
|
console.log("[dsh-remote] dsh web 离线,停止 bridge...");
|
|
1931
|
+
// dsh 重启后端口可能变化:清掉进程内缓存,下一轮优先用插件新写的端口文件探测
|
|
1932
|
+
discoveredUpstream = "";
|
|
1916
1933
|
await stopChildGracefully(bridgeProc); // 同上:Windows 上 kill() 跑不到退出钩子
|
|
1917
1934
|
}
|
|
1918
1935
|
};
|