MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / connectWS

Function connectWS

src/boot.js:33–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32 const wsProto = DEV_PROTO === "https" ? "wss" : "ws";
33 const connectWS = () => {
34 let ws;
35 try {
36 ws = new WebSocket(`${wsProto}://${DEV_HOST}:${DEV_PORT}`);
37 } catch {
38 setTimeout(connectWS, 1000);
39 return;
40 }
41 ws.onmessage = ({ data }) => {
42 if (data === "reload") location.reload();
43 };
44 ws.onclose = () => setTimeout(connectWS, 1000);
45 ws.onerror = () => {};
46 };
47 connectWS();
48};
49

Callers 1

bootDevFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected