shell-mirror 1.5.25 → 1.5.26
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/mac-agent/agent.js +15 -8
- package/package.json +1 -1
package/mac-agent/agent.js
CHANGED
|
@@ -33,15 +33,22 @@ try {
|
|
|
33
33
|
const AGENT_ID = process.env.AGENT_ID || `agent-${uuidv4()}`;
|
|
34
34
|
logToFile(`🆔 Agent ID: ${AGENT_ID}`);
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
// Determine signaling server URL - prefer WEBSOCKET_URL for cloud connections
|
|
37
|
+
let SIGNALING_SERVER_URL;
|
|
38
|
+
if (process.env.WEBSOCKET_URL) {
|
|
39
|
+
SIGNALING_SERVER_URL = process.env.WEBSOCKET_URL;
|
|
40
|
+
logToFile(`🌐 Using cloud WebSocket URL: ${SIGNALING_SERVER_URL}`);
|
|
41
|
+
} else {
|
|
42
|
+
// Fallback to local server configuration
|
|
43
|
+
let connectHost = process.env.HOST || 'localhost';
|
|
44
|
+
if (connectHost === '0.0.0.0') {
|
|
45
|
+
logToFile('[AGENT] Host is 0.0.0.0, connecting to localhost instead.');
|
|
46
|
+
connectHost = 'localhost';
|
|
47
|
+
}
|
|
48
|
+
const PORT = process.env.PORT || 3000;
|
|
49
|
+
SIGNALING_SERVER_URL = `ws://${connectHost}:${PORT}`;
|
|
50
|
+
logToFile(`🌐 Using local WebSocket URL: ${SIGNALING_SERVER_URL}`);
|
|
41
51
|
}
|
|
42
|
-
const PORT = process.env.PORT || 3000;
|
|
43
|
-
const SIGNALING_SERVER_URL = `ws://${connectHost}:${PORT}`;
|
|
44
|
-
logToFile(`🌐 Signaling server URL: ${SIGNALING_SERVER_URL}`);
|
|
45
52
|
|
|
46
53
|
const shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash';
|
|
47
54
|
logToFile(`🐚 Shell: ${shell}`);
|
package/package.json
CHANGED