npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webrtc-explorer

v2.0.0-alpha-v0

Published

P2P Network Routing Overlay designed for the Web platform (browsers)

Downloads

12

Readme

Dependency Status js-standard-style

tl;dr webrtc-explorer is a Chord inspired, P2P Network Routing Overlay designed for the Web platform (browsers), using WebRTC as its layer of transport between peers and WebSockets for the exchange of signalling data (setting up a connection and NAT traversal). Essentially, webrtc-explorer enables your peers (browsers) to communicate between each other without the need to have a server to be the mediator.

Usage

Install

> npm install webrtc-explorer

If you want to use the Signalling Server that comes with webrtc-explorer, you can use it through your terminal after installing webrtc-explorer globally

> npm install webrtc-explorer --global
# ...
> sig-server
Signalling Server Started
# now the signalling server is running

Use browserify to load transpile your JS code that uses webrtc-explorer, so that all of the dependencies are correctly loaded.

API

const explorer = require('webrtc-explorer')

listen

Connects your explorer node to the signalling server, and listens for incomming connections from other peers.

const listener = explorer.createListener((socket) => {
  // socket with another peer
})

listener.listen((err) => {
  if (err) {
    return console.log('Error listening:', err)
  }
  console.log('explorer is now listining to incomming connections')
})

dial

Dials into another peer, using the P2P Overlay Routing.

const socket = explorer.dial(<peerId> [, <readyCallback>])

Note: since an explorer node routes messages for other peers and itself, it needs first to be ready to 'listen', in order to be able to use the network to send.

updateFinger

not implemented yet

updates a finger on the finger table (if no finger was present on that row, it is added).

explorer.updateFinger(<row>)

updateFingerTable

not implemented yet

updates all the rows on the finger table that already had a peer

explorer.updateFingerTable(<row>)

Architecture

Signalling

Currently signalling is performed through a central server. The signalling throught the Chord routing is under development.

Routing

To understand fully webrtc-explorer's core, it is important to be familiar with the [Chord][chord-paper].

I've delivered a talk before about an earlier version of webrtc-explorer, where I explain the routing scheme, you can find it here: https://youtu.be/fNQGGGE__zI?t=13m33s

Connection State

Connections in webrtc-explorer are very similar to typical network socket. Before going to the network, the messages are encasulated with srcId and dstId so that they be routed through the Chord routing (parallel to the encasulation with TCP headers, IP headers, etc)

Notes and other properties

  • Ids have 48 bits (so that is a multiple of 4 (for hex notation) and doesn't require importing a big-num lib to handle over 53 bits operations)
  • The number of fingers of each peer is flexible, however it is recommended to not pass 16 per node (due to browser resource constraints)
  • Each peer is responsible for a segment of the hash ring

Initial Development and release was supported by INESC-ID (circa Mar 2015)

David Dias MSc in Peer-to-Peer Networks by Technical University of Lisbon

This work was developed by David Dias with supervision by Luís Veiga, all in INESC-ID Lisboa (Distributed Systems Group), Instituto Superior Técnico, Universidade de Lisboa, with the support of Fundação para a Ciência e Tecnologia.

More info on the team's work at:

  • http://daviddias.me
  • http://www.gsd.inesc-id.pt/~lveiga

If you use this project, please acknowledge it in your work by referencing the following document:

David Dias and Luís Veiga. browserCloud.js A federated community cloud served by a P2P overlay network on top of the web platform. INESC-ID Tec. Rep. 14/2015, Apr. 2015