MCPcopy Create free account
hub / github.com/Noumena-Network/code / connect

Method connect

src/remote/appServer/client.ts:280–296  ·  view source on GitHub ↗
(args: RemoteAppServerConnectArgs)

Source from the content-addressed store, hash-verified

278 }
279
280 static async connect(args: RemoteAppServerConnectArgs): Promise<RemoteAppServerClient> {
281 if (args.authToken && !websocketUrlSupportsAuthToken(args.websocketUrl)) {
282 throw new Error(
283 `remote auth tokens require wss:// or loopback ws:// URLs; got ${args.websocketUrl}`,
284 )
285 }
286
287 const client = new RemoteAppServerClient({
288 ...args,
289 channelCapacity: Math.max(1, args.channelCapacity ?? DEFAULT_CHANNEL_CAPACITY),
290 connectTimeoutMs: args.connectTimeoutMs ?? DEFAULT_CONNECT_TIMEOUT_MS,
291 initializeTimeoutMs:
292 args.initializeTimeoutMs ?? DEFAULT_INITIALIZE_TIMEOUT_MS,
293 })
294 await client.open()
295 return client
296 }
297
298 async request<T = JsonRpcResult>(request: ClientRequest): Promise<T> {
299 this.assertOpen()

Callers 1

client.test.tsFile · 0.45

Calls 3

openMethod · 0.95
maxMethod · 0.80

Tested by

no test coverage detected