mirror of
https://github.com/yudai/gotty.git
synced 2025-09-21 21:40:49 +02:00
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:
parent
83923b6f39
commit
4f75000256
3 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue