Send data in base64 format

Raw data sometimes include invalid UTF-8 bytes and that brings errors to
WebSocket clients. To avoid the errors, encode data into base64 before
sending it.
This commit is contained in:
Iwasaki Yudai 2015-09-02 20:16:35 -07:00
parent 83923b6f39
commit 4f75000256
3 changed files with 7 additions and 7 deletions

View file

@ -53,7 +53,7 @@
data = event.data.slice(1);
switch(event.data[0]) {
case '0':
term.io.writeUTF16(data);
term.io.writeUTF8(window.atob(data));
break;
case '1':
// pong