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

Chord inspired ring DHT algorithm using WebRTC as transport layer for P2P in the browser

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

webrtc-ring

tl;dr ring inspired ring DHT algorithm using WebRTC as transport layer for P2P in the browser. You can find more about how it works underneath at HOW_DOES_IT_WORK

It enables you to communicate between several browsers in a p2p/decentralized fashion though a DHT.

Badgers

NPM

![Gitter](https://badges.gitter.im/Join Chat.svg) Dependency Status

How to create a node

webrtc-ring uses browserify

var ring = require('webrtc-ring');

var nodeConfig = {
  signalingURL: 'http://url-to-webrtc-ring-signaling-server.com'
};
var node = ring.createNode(nodeConfig);

node.e.on('ready', function () {
  // this node is ready
});

How to communicate with other nodes

Send a message to a Node responsible for the ID 1af17e73721dbe0c40011b82ed4bb1a7dbe3ce29

var toId = '1af17e73721dbe0c40011b82ed4bb1a7dbe3ce29'; 
// 160 bit ID represented in hex(`git_sha1` module is a good way to generate these)

node.send(destID: toId, 
          data: 'hey, how are you doing');

Send a message to this node sucessor (next node in ring)

node.sendSucessor(data: 'hey, how are you doing');

Receive a message

node.e.on('message', function(message) {
  console.log(message);
});

Other options

logging

add the logging flag to your nodeConfig

var nodeConfig = {
  //...
  logging: true
  //...
};

Keywords

FAQs

Package last updated on 27 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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