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

ataraxia-local

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ataraxia-local

Machine-local transport for Ataraxia P2P messaging

  • 0.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-58.97%
Maintainers
1
Weekly downloads
 
Created
Source

ataraxia-local

npm version Dependencies

Machine-local transport for Ataraxia. This transport connects together instances on the same machine via a Unix socket.

Usage

npm install --save ataraxia-local

To use only the machine-local transport:

const Network = require('ataraxia');
const LocalTransport = require('ataraxia-local');

const net = new Network({ name: 'name-of-your-app-or-network' });
net.addTransport(new LocalTransport());

net.start()
  .then(...)
  .catch(...);

The event leader can be used to start a secondary network transport that will handle connections to other machines.

const Network = require('ataraxia');
const LocalTransport = require('ataraxia-local');
const TCPTransport = require('ataraxia-tcp');

const net = new Network({ name: 'name-of-your-app-or-network' });

const local = new LocalTransport();
local.on('leader', () => {
  /*
   * The leader event is emitted when this instance becomes the leader
   * of the machine-local network. This instance will now handle
   * connections to other machines in the network.
   */
  net.addTransport(new TCPTransport());
});
net.addTransport(local);

net.start()
  .then(...)
  .catch(...);

FAQs

Package last updated on 25 Nov 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

  • 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