Socket
Book a DemoInstallSign in
Socket

n2n-overlay-wrtc

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n2n-overlay-wrtc

A WebRTC peer is able to mediate the connection establishment between its neighbors, i.e., it becomes a signaling server for its neighbors. It allows peers to organize their overlay network.

2.0.10
latest
Source
npmnpm
Version published
Weekly downloads
24
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

n2n-overlay-wrtc Build Status

This project aims to ease the creation of overlay networks on top of WebRTC. Additional WebRTC-specific constraints make such projects more difficult than they should be. For instance, establishing a connection requires a round-trip of "offers". Such messages usually transit a dedicated signaling server. The peers of this project still require a signaling server for their entrance in the network. Afterwards, peers become signaling servers too, i.e., they mediate connections between their direct neighbors.

This module divides the entering arcs (inview) from the outgoing arcs (outview).

The way connections are handled are left to the discretion of overlay protocols built on top of this module. A peer with two neighbors can ask to one of them to connect to the other. Several overlay network protocols use neighbor-to-neighbor interactions to converge to a topology exposing the desired properties.

Principle

There exists a network comprising at least Peer :|. Peer :] wants to join this network. :| knows it and opens an access to the network thanks to a signaling server. The signaling server is in charge of transmitting the necessary WebRTC data from both sides. The figure shows this protocol with the 1->2->3->4 steps that can be repeated many times depending on network configurations. If the protocol is successful, it creates a direct browser-to-browser connection from :] to :|.

Peers already in the network do not need to use a signaling server to establish connections, for each of them can act as a signaling server, i.e. as a bridge from a neighbor to another. In the figure, :3, :], and :| are in the network. :3 can establish a WebRTC connection to :| using :]. Such neighbor-to-neighbor connections are common in distributed peer-sampling protocols.

Installation

$ npm install n2n-overlay-wrtc

API

The API is avalaible here

Example

A live example is available here.

The module spray-wrtc extends n2n-overlay-wrtc to implement a random peer-sampling protocol.

Keywords

WebRTC

FAQs

Package last updated on 26 Jun 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.