From 575b566b5339c1825ee57fb33bd1a8e0bdedc2cc Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sat, 21 Nov 2020 16:15:04 +1100 Subject: [PATCH] Removed JSON parse from websocket messages --- src/network/Session.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/Session.js b/src/network/Session.js index 0ffb7a3..0b62980 100644 --- a/src/network/Session.js +++ b/src/network/Session.js @@ -58,7 +58,7 @@ class Session extends EventEmitter { constructor() { super(); this.socket = io(process.env.REACT_APP_BROKER_URL, { - transports: ["websocket"] + transports: ["websocket"], }); this.socket.on( @@ -232,7 +232,7 @@ class Session extends EventEmitter { } _handleSignal(data) { - const { from, signal } = JSON.parse(data); + const { from, signal } = data; if (from in this.peers) { this.peers[from].connection.signal(signal); }