From 4cf040a866e07e33626a13db3b2543c78d295506 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Wed, 23 Nov 2016 20:41:22 +0000 Subject: [PATCH] using the host from the document.location --- app/js/websocket.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/js/websocket.js b/app/js/websocket.js index bcd9835..d470cd8 100644 --- a/app/js/websocket.js +++ b/app/js/websocket.js @@ -3,14 +3,16 @@ const WEBSOCKET = function (model) { const useUrl = 0; let wsUrl = ['localhost', 'silvrtree.co.uk']; const wsPort = '3010'; - +console.log(document.location); if ('https:' === document.location.protocol) { - wsUrl = 'wss://' + wsUrl[useUrl] + ''; + // wsUrl = 'wss://' + wsUrl[useUrl] + ''; + wsUrl = 'wss://' + document.location.host ; // wsPort = ''; } else { //wsUrl = 'ws://localhost:3001'; - wsUrl = 'ws://' + wsUrl[useUrl] + ''; + // wsUrl = 'ws://' + wsUrl[useUrl] + ''; // wsPort = ''; + wsUrl = 'ws://' + document.location.host ; }