1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Remove extra slash in Debug WS connection url and respect http/https

Fixes #59,#60
This commit is contained in:
Nicholas O'Leary 2013-11-06 21:33:25 +00:00
parent 8f71ee4631
commit 3b49c85a8e

View File

@ -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();