-
I am connecting to a websocket, which only accepts and sends binary data. xterm does parse incoming binary data however even if I set the websocket which I attached with attachAddon, to binaryTpe = "arraybuffer" it still continues to send as string/text instead of binary. Details
Steps to reproduce
Anyone got an idea on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes client --> server way always sends text input as text (everything from |
Beta Was this translation helpful? Give feedback.
Yes client --> server way always sends text input as text (everything from
term.onData
event). This is needed to distingish text input from binary data as sent byterm.onBinary
.If you want both to be sent with binary transport, you'd have to implement a protocol, that still makes it possible to separate both event types, if you want to able to utf-8 encode the text parts on server side. If you dont care for utf-8 encoding on server side, you can simply send both event types as Uint8Array (thus always getting bytes, but ofc lose the ability to safely convert text back into unicode).