add socket.io-browserify
This commit is contained in:
parent
4f359c05ca
commit
7c14706e92
2 changed files with 6 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ var bitcore = require('bitcore');
|
|||
var AuthMessage = bitcore.AuthMessage;
|
||||
var util = bitcore.util;
|
||||
var extend = require('util')._extend;
|
||||
var io = require('socket.io-client');
|
||||
var io = require('socket.io-browserify');
|
||||
var preconditions = require('preconditions').singleton();
|
||||
|
||||
/*
|
||||
|
|
@ -244,6 +244,7 @@ Network.prototype._setupConnectionHandlers = function() {
|
|||
preconditions.checkState(this.socket);
|
||||
var self = this;
|
||||
|
||||
alert('setup');
|
||||
self.socket.on('connect', function() {
|
||||
alert('CONNECTED!');
|
||||
self.socket.on('disconnect', function() {
|
||||
|
|
@ -295,7 +296,6 @@ Network.prototype.peerFromCopayer = function(hex) {
|
|||
};
|
||||
|
||||
Network.prototype.start = function(opts, openCallback) {
|
||||
alert('start');
|
||||
opts = opts || {};
|
||||
|
||||
if (this.started) return openCallback();
|
||||
|
|
@ -318,7 +318,8 @@ Network.prototype.start = function(opts, openCallback) {
|
|||
}
|
||||
|
||||
this.socket = io.connect(this.host, {
|
||||
port: this.port
|
||||
port: this.port,
|
||||
reconnection: false
|
||||
});
|
||||
this.socket.emit('subscribe', this.getKey().public.toString('hex'));
|
||||
this.socket.emit('sync');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue