(text: string)
| 114 | } |
| 115 | |
| 116 | public sendText(text: string): void { |
| 117 | if (this.closed) {return;} |
| 118 | const payload = Buffer.from(text, 'utf8'); |
| 119 | this.socket.write(encodeFrame(0x1, payload)); |
| 120 | } |
| 121 | |
| 122 | public sendJson(value: unknown): void { |
| 123 | this.sendText(JSON.stringify(value)); |