Make client request base64 encoding

This makes gotty-client still work.
This commit is contained in:
Søren L. Hansen
2022-03-31 10:46:59 -07:00
parent 1eed97f0f8
commit dd3603c341
8 changed files with 42 additions and 37 deletions

View File

@@ -149,7 +149,7 @@ export class WebTTY {
let maxChunkSize = Math.floor(effectiveBufferSize / 4)*3;
for (let i = 0; i < Math.ceil(dataString.length / maxChunkSize); i++) {
let inputChunk = dataString.substring(i * effectiveBufferSize, Math.min((i + 1) * effectiveBufferSize, dataString.length))
let inputChunk = dataString.substring(i * maxChunkSize, Math.min((i + 1) * maxChunkSize, dataString.length))
this.connection.send(msgInput + btoa(inputChunk));
}
}
@@ -210,6 +210,9 @@ export class WebTTY {
this.term.onResize(resizeHandler);
resizeHandler(termInfo.columns, termInfo.rows);
// Set encoding to base64 (TODO: Fix this up)
connection.send("4base64");
this.term.onInput(
(input: string) => {
this.sendInput(input);