From 0d7edffca8c148d673e3d6a5815c2060dcea0584 Mon Sep 17 00:00:00 2001 From: chrono Date: Sat, 23 Nov 2013 23:45:58 +0100 Subject: [PATCH] Make Websocket connect depend on where the client got the HTML --- public/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index e5908e8..b43cfe7 100644 --- a/public/index.html +++ b/public/index.html @@ -176,9 +176,10 @@ function updateProgress(percentage){ $('#progressBar').html(percentage+'%'); } +var host = "ws://" + window.location.hostname + ":8080"; -var s = new WebSocket("ws://localhost:8080/status"); -var c = new WebSocket("ws://localhost:8080/control"); +var s = new WebSocket(host+"/status"); +var c = new WebSocket(host+"/control"); c.onmessage = function(e)