()
| 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"); |
no test coverage detected