socket.io+browserify=😻
This commit is contained in:
parent
3793023c81
commit
0ceaea9f95
1 changed files with 3 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ var bitcore = require('bitcore');
|
||||||
var AuthMessage = bitcore.AuthMessage;
|
var AuthMessage = bitcore.AuthMessage;
|
||||||
var util = bitcore.util;
|
var util = bitcore.util;
|
||||||
var extend = require('util')._extend;
|
var extend = require('util')._extend;
|
||||||
var io = require('socket.io-browserify');
|
var io = require('socket.io-client');
|
||||||
var preconditions = require('preconditions').singleton();
|
var preconditions = require('preconditions').singleton();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -238,7 +238,6 @@ Network.prototype._setupConnectionHandlers = function() {
|
||||||
preconditions.checkState(this.socket);
|
preconditions.checkState(this.socket);
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
alert('setup');
|
|
||||||
self.socket.on('connect', function() {
|
self.socket.on('connect', function() {
|
||||||
alert('CONNECTED!');
|
alert('CONNECTED!');
|
||||||
self.socket.on('disconnect', function() {
|
self.socket.on('disconnect', function() {
|
||||||
|
|
@ -307,9 +306,8 @@ Network.prototype.start = function(opts, openCallback) {
|
||||||
this.socket.removeAllListeners();
|
this.socket.removeAllListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.socket = io.connect(this.host, {
|
this.socket = io.connect(this.host + ':' + this.port, {
|
||||||
port: this.port,
|
//reconnection: false,
|
||||||
reconnection: false
|
|
||||||
});
|
});
|
||||||
this.socket.emit('subscribe', this.getKey().public.toString('hex'));
|
this.socket.emit('subscribe', this.getKey().public.toString('hex'));
|
||||||
this.socket.emit('sync');
|
this.socket.emit('sync');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue