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.
Safari doesn't support basic authentication for websocket sessions.
This commit introduces a token-based authentication only for websocket
connection.
The token is shared by all clients and that might be not secure. However,
basic authentication itself is insecure and the credential is already
shared by clients, so don't mind.
When `send-encoding` is `utf-8`, hterm translate input from the
clipboard from UTF-16 to UTF-8, even when the input is indeed UTF-8.
This translation messes up all non ASCII input.