aboutsummaryrefslogtreecommitdiff
path: root/client-web/source/protocol
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-09-07 19:17:49 +0200
committermetamuffin <metamuffin@disroot.org>2023-09-07 19:17:49 +0200
commit2d0761b8932f11b01e241e2db3a8f08250efe878 (patch)
tree29814137e2960286d36f3ae4f7c20299eb6d22b0 /client-web/source/protocol
parent6f644481f397af070e2b91b69846e375caafdbda (diff)
downloadkeks-meet-2d0761b8932f11b01e241e2db3a8f08250efe878.tar
keks-meet-2d0761b8932f11b01e241e2db3a8f08250efe878.tar.bz2
keks-meet-2d0761b8932f11b01e241e2db3a8f08250efe878.tar.zst
new protocol
Diffstat (limited to 'client-web/source/protocol')
-rw-r--r--client-web/source/protocol/mod.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client-web/source/protocol/mod.ts b/client-web/source/protocol/mod.ts
index a7e1f63..83ee8cb 100644
--- a/client-web/source/protocol/mod.ts
+++ b/client-web/source/protocol/mod.ts
@@ -10,7 +10,7 @@ import { crypto_encrypt, crypto_seeded_key, crypt_decrypt, crypto_hash } from ".
export class SignalingConnection {
room!: string
websocket!: WebSocket
- signaling_id!: string
+ room_hash!: string
key!: CryptoKey
my_id?: number // needed for outgoing relay messages
@@ -20,9 +20,9 @@ export class SignalingConnection {
constructor() { }
async connect(room: string): Promise<SignalingConnection> {
this.key = await crypto_seeded_key(room)
- this.signaling_id = await crypto_hash(room)
+ this.room_hash = await crypto_hash(room)
log("ws", "connecting…")
- const ws_url = new URL(`${window.location.protocol.endsWith("s:") ? "wss" : "ws"}://${window.location.host}/signaling/${encodeURIComponent(this.signaling_id)}`)
+ const ws_url = new URL(`${window.location.protocol.endsWith("s:") ? "wss" : "ws"}://${window.location.host}/signaling`)
this.websocket = new WebSocket(ws_url)
this.websocket.onerror = () => this.on_error()
this.websocket.onclose = () => this.on_close()
@@ -44,6 +44,7 @@ export class SignalingConnection {
}
on_open() {
log("ws", "websocket opened");
+ this.send_control({ join: { hash: this.room_hash } })
setInterval(() => this.send_control({ ping: null }), 30000) // stupid workaround for nginx disconnecting inactive connections
}
on_error() {