GithubHelp home page GithubHelp logo

mnoth / foxtrot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitpay/foxtrot

0.0 2.0 0.0 147 KB

Simple and secure routing based on Bitcoin cryptography.

License: MIT License

JavaScript 100.00%

foxtrot's Introduction

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.

foxtrot's People

Contributors

gasteve avatar maraoz avatar unusualbob avatar mnoth avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.