X-Git-Url: https://git.r.bdr.sh/rbdr/junction/blobdiff_plain/93fe1aee43a79a23d4c418c230fde0e451259279..e2da0c51692b64318a0f1b8d888536ee632c53d6:/extension/content_script.js diff --git a/extension/content_script.js b/extension/content_script.js index 741e1c4..84a2fd3 100644 --- a/extension/content_script.js +++ b/extension/content_script.js @@ -4,7 +4,7 @@ const internals = { - kSocketUrl: 'http://unlimited.pizza:8000/', + kSocketUrl: 'https://junction.unlimited.pizza/', port: null, socket: null, @@ -19,14 +19,25 @@ try { const mediaStream = await navigator.mediaDevices.getUserMedia({ audio: true }); - internals.socket = io(internals.kSocketUrl); + internals.socket = io(internals.kSocketUrl, { + transports: ['websocket'] + }); + + internals.socket.on('error', function(error) { + + console.error('GENERAL ERROR', error); + }); + + internals.socket.on('connect_error', function(error) { + + console.error('CONNNECT ERROR', error); + }); - console.log('Connecting to server'); internals.socket.on('connect', function() { - console.log("Connected to signaling server"); + console.log("Connected to signaling server, group: ", data.currentUrl); internals.socket.emit('join', { - 'url': currentUrl, + 'url': data.currentUrl, }); }); @@ -48,7 +59,6 @@ console.log(`There are now ${internals.peers} participants`); }); - console.log('Done!'); internals.createAudioElement(data.tada); } catch (err) {