From 3b49c85a8ed1649d56c557f3da68026718e60b44 Mon Sep 17 00:00:00 2001 From: Nicholas O'Leary Date: Wed, 6 Nov 2013 21:33:25 +0000 Subject: [PATCH] Remove extra slash in Debug WS connection url and respect http/https Fixes #59,#60 --- nodes/core/58-debug.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nodes/core/58-debug.html b/nodes/core/58-debug.html index b68073455..acd9c1047 100644 --- a/nodes/core/58-debug.html +++ b/nodes/core/58-debug.html @@ -113,7 +113,10 @@ function debugConnect() { //console.log("debug ws connecting"); - var ws = new WebSocket("ws://"+location.hostname+":"+location.port+document.location.pathname+"/debug"); + var path = location.hostname+":"+location.port+document.location.pathname; + path = path+(path.slice(-1) == "/"?"":"/")+"debug"; + path = "ws"+(document.location.protocol=="https:"?"s":"")+"://"+path; + var ws = new WebSocket(path); ws.onopen = function() { if (errornotification) { errornotification.close();