webrtc-explorer
Advanced tools
Comparing version 1.0.6 to 1.1.0
@@ -12,2 +12,4 @@ var Explorer = require('./../../../src/index.js'); | ||
peerGlobal = peer; | ||
peer.events.on('registered', function(data) { | ||
@@ -14,0 +16,0 @@ console.log('registered with Id:', data.peerId); |
{ | ||
"name": "webrtc-explorer", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "Chord inspired ring DHT algorithm using WebRTC as transport layer for P2P in the browser", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -33,4 +33,4 @@ var SimplePeer = require('simple-peer'); | ||
if(data.offer.intentId !== intentId) { | ||
log('OK: not right intentId: ', | ||
data.offer.intentId, intentId); | ||
// log('OK: not right intentId: ', | ||
// data.offer.intentId, intentId); | ||
return; | ||
@@ -37,0 +37,0 @@ } |
@@ -30,3 +30,3 @@ var Id = require('dht-id'); | ||
channelManager.connect(data.fingerId, function(err, channel) { | ||
log('added a channel to %s on finger table row %s', | ||
log('finger table row update: ', | ||
data.rowIndex, data.fingerId); | ||
@@ -33,0 +33,0 @@ if(!table[data.rowIndex]) { |
@@ -8,3 +8,3 @@ var ee2 = require('eventemitter2').EventEmitter2; | ||
log = bows('webrtc-ring'); | ||
log = bows('webrtc-explorer'); | ||
@@ -11,0 +11,0 @@ exports = module.exports = Peer; |
@@ -10,31 +10,39 @@ var Explorer = require('./../src/index.js'); | ||
var config = { | ||
signalingURL: 'http://localhost:9000', | ||
logging: true | ||
signalingURL: 'http://localhost:9000' | ||
}; | ||
var peer; | ||
var peer = new Explorer(config); | ||
pp.register('register-peer', function(data) { | ||
pp.register('register-peer', function() { | ||
console.log('register-peer'); | ||
peer = new Explorer(config); | ||
peer.register(); | ||
}); | ||
pp.register('send', function(data) { | ||
console.log('send-message', data.dstId, data.message); | ||
peer.send(data.dstId, data.message); | ||
}); | ||
peer.events.on('registered', function() { | ||
console.log('registered'); | ||
peer.events.on('registered', function(data) { | ||
console.log('peer-registered'); | ||
pp.tell({ | ||
peerId: data.peerId, | ||
message: 'peer-registered' | ||
}); | ||
}); | ||
peer.events.on('ready', function() { | ||
pp.tell({ | ||
peerId: peer.id(), | ||
message: 'peer is ready' | ||
}); | ||
peer.events.on('ready', function(){ | ||
console.log('peer-ready'); | ||
pp.tell({ | ||
peerId: peer.peerId.toHex(), | ||
message: 'peer-ready' | ||
}); | ||
}); | ||
peer.events.on('message', function(envelope) { | ||
console.log('received-message', envelope); | ||
pp.tell({ | ||
peerId: peer.peerId.toHex(), | ||
message: envelope | ||
}); | ||
peer.events.on('message', function(message) { | ||
console.log('message-receive', message); | ||
pp.tell({ | ||
peerId: peer.peerId.toHex(), | ||
message: message | ||
}); | ||
}); | ||
}); | ||
@@ -41,0 +49,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14
18974
416