Skip to content

Anternet/anternet-broadcast.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anternet-broadcast.js

build npm Join the chat at https://gitter.im/Anternet/anternet.js npm

Anternet library for broadcast messages to other peers that listening on the same channel.

Example

const Anternet = require('anternet');
const Broadcast = require('anternet-broadcast');
              
const anternet = new Anternet();
const broadcast = Broadcast.generate();

console.log(broadcast.id); // print broadcast id string

// send messages to a given peer
const address = '127.0.0.1';
const port = 12345; 
const msg = {a: 'Hello world', foo: 'bar'};

broadcast.send(anternet, msg, port, address, (err) => {
  if (err) throw err;

  console.log('success!');
});

License

MIT License. Copyright © 2016 Moshe Simantov

About

Anternet library for broadcast messages to other peers that listening on the same channel.

Resources

License

Stars

Watchers

Forks

Packages

No packages published