Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webrtc-explorer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-explorer - npm Package Compare versions

Comparing version 1.0.6 to 1.1.0

config/test.json

2

examples/try-it-out/app/app.js

@@ -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);

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc