MCPcopy Index your code
hub / github.com/cameri/nostream / connect

Function connect

test/integration/features/helpers.ts:15–27  ·  view source on GitHub ↗
(_name: string)

Source from the content-addressed store, hash-verified

13 messages.reduce((hash: Hash, message: Uint8Array) => hash.update(message), createHash('sha256')).digest()
14
15export async function connect(_name: string): Promise<WebSocket> {
16 const host = 'ws://localhost:18808'
17 const ws = new WebSocket(host)
18 return new Promise<WebSocket>((resolve, reject) => {
19 ws.once('open', () => {
20 resolve(ws)
21 })
22 .once('error', reject)
23 .once('close', () => {
24 ws.removeAllListeners()
25 })
26 })
27}
28
29let eventCount = 0
30

Callers 1

shared.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected