dsh-mobile-plugin 0.1.64 → 0.1.66
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/lib/impl.js +3 -1
- package/lib/panel/index.html +8 -8
- package/lib/relay/lan-proxy.js +7 -0
- package/lib/relay/port-allocator.cjs +18 -3
- package/lib/routes/control-plane.js +64 -74
- package/lib/routes/mobile-api.js +16 -0
- package/lib/sidecar-lifecycle.cjs +19 -1
- package/package.json +1 -1
package/lib/impl.js
CHANGED
|
@@ -241,10 +241,12 @@ function apply(ctx) {
|
|
|
241
241
|
// 每次同步前都跑一次探测,而不是只在启动时探一次:`/api/relay/config` 改了
|
|
242
242
|
// lanPort 之后同样要走这条路(否则新端口被占时又会退回死地址)。并发调用复用
|
|
243
243
|
// 在飞的那次——探测要占一个监听句柄,重复触发没有意义。
|
|
244
|
+
// ⚠️ `ours` 必须传:**自己占着的号不是「被占」**,不认它就会把落盘端口漂走(判据、
|
|
245
|
+
// 代价与现场见 sidecar-lifecycle 的 getOwnLanPort;只读的二维码路由也会触发)。
|
|
244
246
|
const resolveLanPort = () => {
|
|
245
247
|
if (!state.lanEnabled) { lanPortProbe = null; return Promise.resolve(state.lanPort) }
|
|
246
248
|
if (lanPortProbe) return lanPortProbe
|
|
247
|
-
lanPortProbe = resolvePort(state.lanPort)
|
|
249
|
+
lanPortProbe = resolvePort(state.lanPort, '0.0.0.0', { ours: sidecarLifecycle.getOwnLanPort() })
|
|
248
250
|
.then(resolved => {
|
|
249
251
|
lanPortAdjusted = Boolean(resolved.adjusted)
|
|
250
252
|
if (resolved.adjusted && resolved.port > 0) {
|