shell-mirror 1.5.9 → 1.5.10
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/public/app/terminal.js +18 -2
package/package.json
CHANGED
package/public/app/terminal.js
CHANGED
|
@@ -95,7 +95,15 @@ async function discoverAgents() {
|
|
|
95
95
|
console.log('[DISCOVERY] 🔍 Starting agent discovery...');
|
|
96
96
|
agentList.innerHTML = '<p style="color: #ccc;">Searching for Mac agents...</p>';
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
// Production WebSocket server configuration
|
|
99
|
+
let signalingUrl;
|
|
100
|
+
if (window.location.hostname === 'shellmirror.app') {
|
|
101
|
+
// Production: Use separate WebSocket server (to be deployed)
|
|
102
|
+
signalingUrl = 'wss://ws.shellmirror.app';
|
|
103
|
+
} else {
|
|
104
|
+
// Development: Use local server
|
|
105
|
+
signalingUrl = (window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host;
|
|
106
|
+
}
|
|
99
107
|
const discoveryWs = new WebSocket(`${signalingUrl}?role=discovery`);
|
|
100
108
|
|
|
101
109
|
discoveryWs.onopen = () => {
|
|
@@ -191,7 +199,15 @@ function displayAvailableAgents(agents) {
|
|
|
191
199
|
|
|
192
200
|
async function initialize() {
|
|
193
201
|
console.log('[CLIENT] 🚀 Initializing WebRTC connection to agent:', AGENT_ID);
|
|
194
|
-
|
|
202
|
+
// Production WebSocket server configuration
|
|
203
|
+
let signalingUrl;
|
|
204
|
+
if (window.location.hostname === 'shellmirror.app') {
|
|
205
|
+
// Production: Use separate WebSocket server (to be deployed)
|
|
206
|
+
signalingUrl = 'wss://ws.shellmirror.app';
|
|
207
|
+
} else {
|
|
208
|
+
// Development: Use local server
|
|
209
|
+
signalingUrl = (window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host;
|
|
210
|
+
}
|
|
195
211
|
ws = new WebSocket(`${signalingUrl}?role=client`);
|
|
196
212
|
|
|
197
213
|
ws.onopen = () => {
|