From 05c03e5906aae8382413b4938fd6765e072584d7 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 6 Aug 2020 15:18:49 +0200 Subject: [PATCH] dont accept websocket messages for other sids --- raspberry/roberto/views/frontend/templates/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/raspberry/roberto/views/frontend/templates/index.html b/raspberry/roberto/views/frontend/templates/index.html index 73cc37c..ee1a97f 100644 --- a/raspberry/roberto/views/frontend/templates/index.html +++ b/raspberry/roberto/views/frontend/templates/index.html @@ -151,6 +151,12 @@ return; } + if (msg.sid == null || msg.sid != socket.id) { + console.log("ignoring message for unknown sid"); + console.log(socket.id); + return; + } + if (!webrtcPeerConnection) { webrtcPeerConnection = new RTCPeerConnection(webrtcConfiguration); webrtcPeerConnection.ontrack = onAddRemoteStream;