MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / newWebSocket

Function newWebSocket

frontend/util/wsutil.ts:19–25  ·  view source on GitHub ↗
(url: string, headers: { [key: string]: string })

Source from the content-addressed store, hash-verified

17type ComboWebSocket = NodeWebSocketType | WebSocket;
18
19function newWebSocket(url: string, headers: { [key: string]: string }): ComboWebSocket {
20 if (NodeWebSocket) {
21 return new NodeWebSocket(url, { headers });
22 } else {
23 return new WebSocket(url);
24 }
25}
26
27export { newWebSocket };
28export type { ComboWebSocket as WebSocket };

Callers 1

connectNowMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected