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

shallot-routing

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shallot-routing

Small scale distributed onion routing over WebRTC.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Shallot

Small-scale onion routing over WebRTC, built on top of Conductor-Chord in ES6.

DISCLAIMER: THIS PROJECT IS A PROOF-OF-CONCEPT, AND SHOULD NOT BE USED WHERE SERIOUS SECURITY IS DESIRED!

Overview

Shallot uses the chord network to allow opening of an onion route to any other node of a known ID. The idea is that this can allow for security-focused apps to be designed around Chord's File System and ownership of keys, allowing you to tie usernames in an app to node IDs if desired.

Routes in the system are one-way; this approach is taken to minimize the risk of route failure affecting both directions of traffic flow, similarly to I2P.

Standard Usage

Shallot can be used either as a module for an existing Chord system, or as the basis of such a system:

//Full Shallot (includes Chord)
var Shallot = require("shallot").Shallot;

//Module Only
var Module = require("shallot").ShallotModule;

window.s = new Shallot({
  chordConfig: {
    // See Chord repo for details.
  },

  shallotConfig: {
    // Amount of nodes before endpoint.
    routeLength: 3,

    // Timeout duration for each call along the route.
    callTimeout: 1500,

    // Max attempts for each call along the route.
    maxCallRetries: 3,

    // Time to cache answered states for calls.
    rcCacheDuration: 20000
  }
});

//Join a chord network...
s.join("ws://mcfelix.me:7171")
  .then(
    () => {
      //Act on connections sent to us.
      s.on("receiveConnection", conn => {
        //Listening for messages on channels we receive.
        conn.on("data", data => console.log(`[DATA] ${conn.startId}): ${data}`))
      })

      //Opening a connection to another node.
      s.connectTo(/* id */)
        .then(
          session => session.send("Hello World!"),
          error => console.log("Error encountered while opening! " + error)
        )
    },

    error => {
      alert("Couldn't join chord server: " + error);
    }
  )

For a server node, using my modified wrtc:

var Shallot = require("shallot").Shallot,
  wrtc = require("wrtc"),
  SegfaultHandler = require("segfault-handler");

SegfaultHandler.registerHandler("crash.log");

var s = new Shallot(
  {
    chordConfig:{
      conductorConfig: {
        rtc_facade: wrtc
      },

      isServer: true,

      debug: true
    }
  }
);

Changelog

1.0.0

  • Initial version.

Keywords

FAQs

Package last updated on 06 Mar 2016

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