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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user