|
@@ -22,6 +22,7 @@ function Peer(id, options) {
|
|
port: util.CLOUD_PORT,
|
|
port: util.CLOUD_PORT,
|
|
key: 'peerjs',
|
|
key: 'peerjs',
|
|
path: '/',
|
|
path: '/',
|
|
|
|
+ token: util.randomToken(),
|
|
config: util.defaultConfig
|
|
config: util.defaultConfig
|
|
}, options);
|
|
}, options);
|
|
this.options = options;
|
|
this.options = options;
|
|
@@ -150,7 +151,7 @@ Peer.prototype._retrieveId = function(cb) {
|
|
Peer.prototype._initialize = function(id) {
|
|
Peer.prototype._initialize = function(id) {
|
|
var self = this;
|
|
var self = this;
|
|
this.id = id;
|
|
this.id = id;
|
|
- this.socket.start(this.id);
|
|
|
|
|
|
+ this.socket.start(this.id, this.options.token);
|
|
}
|
|
}
|
|
|
|
|
|
/** Handles messages from the server. */
|
|
/** Handles messages from the server. */
|