MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / constructor

Method constructor

src/debug/dart_debug_protocol.ts:353–361  ·  view source on GitHub ↗
(uri: string)

Source from the content-addressed store, hash-verified

351 private eventListeners: { [key: string]: (message: VMEvent) => void } = {};
352
353 constructor(uri: string) {
354 const url = new URL(uri);
355 if (url.protocol.startsWith("http")) {
356 url.protocol = url.protocol === "https" ? "wss" : "ws";
357 uri = url.toString();
358 }
359 this.socket = new WebSocket(uri, { followRedirects: true });
360 this.socket.on("message", (data: Buffer) => this.handleData(data.toString()));
361 }
362
363 public onOpen(cb: () => void) {
364 this.socket.on("open", cb);

Callers

nothing calls this directly

Calls 3

handleDataMethod · 0.95
onMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected