|
@@ -21,6 +21,7 @@ function Peer(id, options) {
|
|
|
host: util.CLOUD_HOST,
|
|
|
port: util.CLOUD_PORT,
|
|
|
key: 'peerjs',
|
|
|
+ path: '/',
|
|
|
config: util.defaultConfig
|
|
|
}, options);
|
|
|
this.options = options;
|
|
@@ -28,6 +29,14 @@ function Peer(id, options) {
|
|
|
if (options.host === '/') {
|
|
|
options.host = window.location.hostname;
|
|
|
}
|
|
|
+ // Set path correctly.
|
|
|
+ if (options.path[0] !== '/') {
|
|
|
+ options.path = '/' + options.path;
|
|
|
+ }
|
|
|
+ if (options.path[options.path.length - 1] !== '/') {
|
|
|
+ options.path += '/';
|
|
|
+ }
|
|
|
+
|
|
|
// Set whether we use SSL to same as current host
|
|
|
if (options.secure === undefined && options.host !== util.CLOUD_HOST) {
|
|
|
options.secure = util.isSecure();
|