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
1 changed files with 4 additions and 1 deletions

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