https://github.com/bitpay/foxtrot
Simple and secure routing based on Bitcoin cryptography.
https://github.com/bitpay/foxtrot
Last synced: 3 months ago
JSON representation
Simple and secure routing based on Bitcoin cryptography.
- Host: GitHub
- URL: https://github.com/bitpay/foxtrot
- Owner: bitpay
- License: mit
- Created: 2014-10-27T15:22:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T09:04:35.000Z (over 3 years ago)
- Last Synced: 2024-12-08T21:45:48.512Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 249 KB
- Stars: 115
- Watchers: 17
- Forks: 39
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Foxtrot
[](https://www.npmjs.org/package/foxtrot)
[](https://travis-ci.org/bitpay/foxtrot)
[](https://coveralls.io/r/bitpay/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.stdin.pipe(client);
client.pipe(process.stdout);
});
```
For more advanced examples and configuration, see the examples folder
#License
**Code released under [the MIT license](https://github.com/bitpay/foxtrot/blob/master/LICENSE).**
Copyright 2014 BitPay, Inc.