From 4a67f4537c824b0095b75926730c30f0f5a76e16 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sun, 31 Jan 2016 08:59:22 -0500 Subject: [PATCH] fix(cloudcmd) loadSocket, loadJquery: prefix --- lib/client/config.js | 4 +++- lib/client/dom.js | 8 +++----- lib/server.js | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/client/config.js b/lib/client/config.js index 32f9bde8..8f3b3c22 100644 --- a/lib/client/config.js +++ b/lib/client/config.js @@ -53,6 +53,7 @@ var CloudCmd, Util, DOM, io; function initSocket(error) { var socket, href = getHost(), + prefix = CloudCmd.PREFIX, FIVE_SECONDS = 5000, save = function(data) { socket.send(data); @@ -61,7 +62,8 @@ var CloudCmd, Util, DOM, io; if (!error) { socket = io.connect(href + '/config', { 'max reconnection attempts' : Math.pow(2, 32), - 'reconnection limit' : FIVE_SECONDS + 'reconnection limit' : FIVE_SECONDS, + path: prefix + '/socket.io' }); auth(socket); diff --git a/lib/client/dom.js b/lib/client/dom.js index ddb6b32f..ad4b504d 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -333,7 +333,7 @@ var CloudCmd, Util, DOM, CloudFunc; } local = local.map(function(url) { - return o.noPrefix ? url : prefix + url; + return prefix + url; }); remote = remoteTmpls.map(function(tmpl) { @@ -354,8 +354,7 @@ var CloudCmd, Util, DOM, CloudFunc; */ this.loadJquery = function(callback) { DOM.loadRemote('jquery', { - name : '$', - noPrefix: true + name : '$' }, callback); return DOM; @@ -363,8 +362,7 @@ var CloudCmd, Util, DOM, CloudFunc; this.loadSocket = function(callback) { DOM.loadRemote('socket', { - name : 'io', - noPrefix: true + name : 'io' }, callback); return DOM; diff --git a/lib/server.js b/lib/server.js index 18970333..56888af2 100644 --- a/lib/server.js +++ b/lib/server.js @@ -38,7 +38,9 @@ app.use(cloudcmd({ config: options, - socket: io.listen(server) + socket: io(server, { + path: config('prefix') + '/socket.io' + }) })); if (port < 1 || port > 65535)