This commit is contained in:
Starbeamrainbowlabs 2021-10-02 03:03:49 +01:00
parent ba377874b1
commit b3da7fea17
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -72,6 +72,7 @@ class Connection extends EventEmitter {
async send(message) { async send(message) {
// TODO: Implement a binary frame-based protocol here instead? It would be 33% more bandwidth efficient. // TODO: Implement a binary frame-based protocol here instead? It would be 33% more bandwidth efficient.
// Perhaps <length> <data>? If messages are too long, we'll have to do something about that though.... // Perhaps <length> <data>? If messages are too long, we'll have to do something about that though....
// TODO: Consider https://devdocs.io/node/crypto#crypto.createCipheriv() - which lets us use any openssl ciphers we like - e.g. ChaCha20-Poly1305
let payload = JSON.stringify(message); let payload = JSON.stringify(message);
payload = encrypt_bytes(this.session_key, payload); payload = encrypt_bytes(this.session_key, payload);