settings: change Async.js opts

This commit is contained in:
Manuel Araoz 2014-09-10 13:09:57 -07:00
commit 6152227668
2 changed files with 9 additions and 14 deletions

View file

@ -36,7 +36,6 @@ var Insight = function(opts) {
this.listeningBlocks = false;
this.url = opts.url;
alert(this.url);
this.opts = {
'reconnection': opts.reconnection || true,
'reconnectionDelay': opts.reconnectionDelay || 1000,

View file

@ -14,9 +14,7 @@ function Network(opts) {
var self = this;
opts = opts || {};
this.maxPeers = opts.maxPeers || 12;
this.host = opts.host || 'localhost';
this.port = opts.port || 3001;
this.schema = opts.schema || 'https';
this.url = opts.url || 'http//localhost:30001';
this.secretNumber = opts.secretNumber;
this.cleanUp();
}
@ -197,8 +195,7 @@ Network.prototype._onMessage = function(enc) {
var self = this;
switch (payload.type) {
case 'hello':
if (typeof payload.secretNumber === 'undefined' || payload.secretNumber !== this.secretNumber)
{
if (typeof payload.secretNumber === 'undefined' || payload.secretNumber !== this.secretNumber) {
this._sendRejectConnection(sender);
this._deletePeer(enc.pubkey, 'incorrect secret number');
return;
@ -326,11 +323,10 @@ Network.prototype.start = function(opts, openCallback) {
};
Network.prototype.createSocket = function() {
var hostPort = this.schema + '://' + this.host + ':' + this.port;
return io.connect(hostPort, {
return io.connect(this.url, {
reconnection: true,
'force new connection': true,
'secure': this.schema === 'https',
'secure': this.url.indexOf('https') > -1,
});
};