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

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() { function debugConnect() {
//console.log("debug ws connecting"); //console.log("debug ws connecting");
var path = location.hostname+":"+location.port+document.location.pathname; 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; path = "ws"+(document.location.protocol=="https:"?"s":"")+"://"+path;
var ws = new WebSocket(path); var ws = new WebSocket(path);
ws.onopen = function() { ws.onopen = function() {

View File

@ -79,7 +79,11 @@ DebugNode.send = function(msg) {
} }
DebugNode.activeConnections = []; 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.wsServer.on('connection',function(ws) {
DebugNode.activeConnections.push(ws); DebugNode.activeConnections.push(ws);
ws.on('close',function() { ws.on('close',function() {