shell-mirror 1.5.25 → 1.5.27

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.
Files changed (2) hide show
  1. package/mac-agent/agent.js +15 -8
  2. package/package.json +1 -1
@@ -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
- // If the server is configured to listen on 0.0.0.0, we must connect to localhost.
37
- let connectHost = process.env.HOST || 'localhost';
38
- if (connectHost === '0.0.0.0') {
39
- logToFile('[AGENT] Host is 0.0.0.0, connecting to localhost instead.');
40
- connectHost = 'localhost';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shell-mirror",
3
- "version": "1.5.25",
3
+ "version": "1.5.27",
4
4
  "description": "Access your Mac shell from any device securely. Perfect for mobile coding with Claude Code CLI, Gemini CLI, and any shell tool.",
5
5
  "main": "server.js",
6
6
  "bin": {