livedesk 0.1.250 → 0.1.252
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/README.md +6 -4
- package/bin/livedesk.js +2 -2
- package/hub/src/remote-hub.js +31 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,10 +16,12 @@ continues to listen on the LAN.
|
|
|
16
16
|
On startup, the launcher finds stale processes whose command line identifies
|
|
17
17
|
them as a LiveDesk Hub, even if the old Hub is still starting and has not
|
|
18
18
|
finished binding its ports. It also checks the Hub ports (`5179` and `5197`),
|
|
19
|
-
waits for
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
waits for stale LiveDesk processes to exit, and then starts the new Hub. The
|
|
20
|
+
client endpoint remains fixed at TCP `5197` by default so firewall rules,
|
|
21
|
+
router forwarding, and direct clients keep a stable contract. An unrelated
|
|
22
|
+
process is preserved and reported instead of being terminated; stop it or use
|
|
23
|
+
an explicit `--remote-port` value. Pass `--no-clean` to disable the startup
|
|
24
|
+
cleanup explicitly.
|
|
23
25
|
|
|
24
26
|
## Client
|
|
25
27
|
|
package/bin/livedesk.js
CHANGED
|
@@ -37,7 +37,7 @@ Hub options:
|
|
|
37
37
|
--host <host> Hub HTTP host. Default: 127.0.0.1
|
|
38
38
|
--port <port> Hub HTTP port. Default: 5179
|
|
39
39
|
--remote-port <port>
|
|
40
|
-
Client connection port. Default: 5197
|
|
40
|
+
Client connection port. Default: 5197.
|
|
41
41
|
--no-clean Do not stop existing processes on the Hub ports.
|
|
42
42
|
|
|
43
43
|
Common:
|
|
@@ -292,7 +292,7 @@ async function stopProcessesOnPorts(ports) {
|
|
|
292
292
|
const blocked = records.filter(record => record?.PortAvailable !== true || (record?.Port === 0 && record?.ProcessGone !== true));
|
|
293
293
|
if (blocked.length > 0) {
|
|
294
294
|
const summary = blocked.map(record => `${record.Pid}:${record.ProcessName || 'unknown'}@${record.Port}[port-free=${record.PortAvailable === true},process-gone=${record.ProcessGone === true}]`).join(', ');
|
|
295
|
-
throw new Error(`LiveDesk Hub startup cleanup could not release port/process owner(s): ${summary}.
|
|
295
|
+
throw new Error(`LiveDesk Hub startup cleanup could not release port/process owner(s): ${summary}. LiveDesk keeps the configured port fixed; stop that process or choose an explicit --port/--remote-port value.`);
|
|
296
296
|
}
|
|
297
297
|
return;
|
|
298
298
|
}
|
package/hub/src/remote-hub.js
CHANGED
|
@@ -4371,21 +4371,20 @@ export function createRemoteHub(options = {}) {
|
|
|
4371
4371
|
});
|
|
4372
4372
|
}
|
|
4373
4373
|
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
await new Promise((resolve, reject) => {
|
|
4380
|
-
server = net.createServer(handleSocket);
|
|
4381
|
-
server.once('error', err => {
|
|
4374
|
+
function listenOnPort(port) {
|
|
4375
|
+
return new Promise((resolve, reject) => {
|
|
4376
|
+
const candidateServer = net.createServer(handleSocket);
|
|
4377
|
+
server = candidateServer;
|
|
4378
|
+
candidateServer.once('error', err => {
|
|
4382
4379
|
lastError = err?.message || String(err);
|
|
4383
|
-
server
|
|
4380
|
+
if (server === candidateServer) {
|
|
4381
|
+
server = null;
|
|
4382
|
+
}
|
|
4384
4383
|
reject(err);
|
|
4385
4384
|
});
|
|
4386
|
-
|
|
4385
|
+
candidateServer.listen(port, host, () => {
|
|
4387
4386
|
started = true;
|
|
4388
|
-
boundPort =
|
|
4387
|
+
boundPort = candidateServer.address()?.port || port;
|
|
4389
4388
|
lastError = '';
|
|
4390
4389
|
logEvent('remote', `LiveDesk Hub client endpoint listening on tcp://${host}:${boundPort}`, 'success');
|
|
4391
4390
|
if (host === '0.0.0.0' || host === '::') {
|
|
@@ -4395,6 +4394,27 @@ export function createRemoteHub(options = {}) {
|
|
|
4395
4394
|
resolve();
|
|
4396
4395
|
});
|
|
4397
4396
|
});
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4399
|
+
async function start() {
|
|
4400
|
+
if (!enabled || started) {
|
|
4401
|
+
return getStatus({ includeSecrets: false });
|
|
4402
|
+
}
|
|
4403
|
+
|
|
4404
|
+
try {
|
|
4405
|
+
await listenOnPort(requestedPort);
|
|
4406
|
+
} catch (error) {
|
|
4407
|
+
if (error?.code === 'EADDRINUSE') {
|
|
4408
|
+
const conflict = new Error(
|
|
4409
|
+
`LiveDesk Hub requires client endpoint TCP ${requestedPort}, but that port is already in use. Close the owning process or start Hub with an explicit --remote-port value.`);
|
|
4410
|
+
conflict.code = 'EADDRINUSE';
|
|
4411
|
+
conflict.port = requestedPort;
|
|
4412
|
+
conflict.cause = error;
|
|
4413
|
+
lastError = conflict.message;
|
|
4414
|
+
throw conflict;
|
|
4415
|
+
}
|
|
4416
|
+
throw error;
|
|
4417
|
+
}
|
|
4398
4418
|
|
|
4399
4419
|
return getStatus({ includeSecrets: false });
|
|
4400
4420
|
}
|