Move Debug ws endpoint to /debug/ws

fixes #61
This commit is contained in:
Nicholas O'Leary 2013-11-14 14:40:34 +00:00
parent d2208fae83
commit 82b863805d
2 changed files with 6 additions and 2 deletions

View File

@ -114,7 +114,7 @@
function debugConnect() {
//console.log("debug ws connecting");
var path = location.hostname+":"+location.port+document.location.pathname;
path = path+(path.slice(-1) == "/"?"":"/")+"debug";
path = path+(path.slice(-1) == "/"?"":"/")+"debug/ws";
path = "ws"+(document.location.protocol=="https:"?"s":"")+"://"+path;
var ws = new WebSocket(path);
ws.onopen = function() {

View File

@ -79,7 +79,11 @@ DebugNode.send = function(msg) {
}
DebugNode.activeConnections = [];
DebugNode.wsServer = new ws.Server({server:RED.server});
var path = RED.settings.httpRoot || "/";
path = path + (path.slice(-1) == "/" ? "":"/") + "debug/ws";
DebugNode.wsServer = new ws.Server({server:RED.server,path:path});
DebugNode.wsServer.on('connection',function(ws) {
DebugNode.activeConnections.push(ws);
ws.on('close',function() {