Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #154 from dcolens/master

Add support for configuring the client-side socket.io's path (better reverse-proxy support)
  • Loading branch information...
commit db4cfb04e0d46615673b95e4d4320732005e23d1 2 parents 2c5945f + 9e15ee5
@ericz ericz authored
Showing with 7 additions and 1 deletion.
  1. +4 −0 doc/public/user_manual.md
  2. +3 −1 lib/client/now.js
View
4 doc/public/user_manual.md
@@ -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
4 lib/client/now.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.