Socket
Book a DemoInstallSign in
Socket

foxtrot

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foxtrot

A simple routing network.

0.0.1
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

Foxtrot

A simple and secure routing network based on bitcoin cryptography. Foxtrot enables easy p2p communications and has built-in mechanisms for peer discovery, creation of services addressable by public keys, and establishing encrypted connections.

Installation

npm install foxtrot

Example

The easiest way to connect to the foxtrot network and send some data is to spawn a server:

var foxtrot = require('foxtrot');

var server = foxtrot.createServer();
console.log('server listening on '+server.key.public.toString('hex'));
server.on('connect', function(socket) {
  socket.write('hello from server!\n');
  socket.on('data', function(data) {
    socket.write(data);
  }); 
});

and have a client connect to it:

var foxtrot = require('foxtrot');

var server = '024a4bf8759a8a28714d099e044dea99b20dd93bc86168568a0a97cd9d205e844a'; // server foxtrot address
var client = foxtrot.connect({
  address: new Buffer(server, 'hex')
}, function() {
  console.log('connected to server!');
  process.stdout.pipe(client);
  client.pipe(process.stdout);
});

For more advanced examples and configuration, see the examples folder

#License

Code released under the MIT license.

Copyright 2014 BitPay, Inc.

FAQs

Package last updated on 29 Oct 2014

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.