Add support for configuring the client-side socket.io's path (better reverse-proxy support) #154

Merged
merged 2 commits into from Jan 2, 2012
@@ -217,6 +217,10 @@ available options and their defaults:
// Do note that the object that this points to should already exist by the time now.js is loaded.
}
+If the `client.socketio.resource` option is set it will also be used
+for the path of the socket.io.js file. This option can be useful in
+the case of a reverse proxy setup.
+
If the options object is incomplete, the default values will be used
in place of any missing options.
View
@@ -6,6 +6,8 @@
return nowObjects[uri];
}
options = options || {};
+ options.socketio = options.socketio || {};
+ options.socketio.resource = options.socketio.resource || "socket.io";
var socket;
var closures = {};
@@ -535,7 +537,7 @@
};
var dependencies = [
- { key: 'io', path: '/socket.io/socket.io.js'}
+ { key: 'io', path: '/' + now.core.options.socketio.resource + '/socket.io.js'}
];
var dependenciesLoaded = 0;