MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / connectToServer

Function connectToServer

app/src/modules/hub.js:405–424  ·  view source on GitHub ↗
(serverId)

Source from the content-addressed store, hash-verified

403}
404
405export function connectToServer(serverId) {
406 if (hubConnectingServerId) return;
407 const servers = getSavedServers();
408 const s = servers.find(x => x.id === serverId);
409 if (!s) { showToast('Server not found'); return; }
410 if (!s.wsUrl) {
411 const parsed = parseServerAddress(s.addr);
412 if (!parsed.ok) { showToast('Invalid server address'); return; }
413 s.wsUrl = parsed.wsUrl;
414 s.cacheAddr = parsed.cacheAddr;
415 saveServerList(servers);
416 }
417 setServerAddr(s.addr);
418 setServerWsUrl(s.wsUrl);
419 setServerCacheAddr(s.cacheAddr);
420 setServerToken(s.token || '');
421 showHubConnectOverlay(s);
422 renderHubCards();
423 connect();
424}
425
426// ---- Hub add/edit dialog ----
427function openAddServerDialog() {

Callers 1

renderHubCardsFunction · 0.70

Calls 11

showToastFunction · 0.90
parseServerAddressFunction · 0.90
setServerAddrFunction · 0.90
setServerWsUrlFunction · 0.90
setServerCacheAddrFunction · 0.90
setServerTokenFunction · 0.90
connectFunction · 0.90
getSavedServersFunction · 0.70
saveServerListFunction · 0.70
showHubConnectOverlayFunction · 0.70
renderHubCardsFunction · 0.70

Tested by

no test coverage detected