MCPcopy
hub / github.com/socketio/socket.io / #open

Method #open

examples/basic-websocket-client/src/index.js:64–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 }
63
64 #open() {
65 this.#ws = new WebSocket(this.#createUrl());
66 this.#ws.onmessage = ({ data }) => this.#onMessage(data);
67 // dummy handler for Node.js
68 this.#ws.onerror = noop;
69 this.#ws.onclose = () => this.#onClose("transport close");
70 }
71
72 #createUrl() {
73 const uri = this.#uri.replace(/^http/, "ws");

Callers 2

constructorMethod · 0.95
#onCloseMethod · 0.95

Calls 3

#createUrlMethod · 0.95
#onMessageMethod · 0.95
#onCloseMethod · 0.95

Tested by

no test coverage detected