Simple broadcasting and repeating of JSON messages using net sockets
JavaScript
Pull request Compare This branch is 9 commits behind ajlopez:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
samples/Broadcast
test
.gitignore
.npmignore
LICENSE
README.md
package.json

README.md

SimpleBroadcast

Simple broadcasting of JSON messages using net sockets.

Installation

Via npm on Node:

npm install simplebroadcast

Reference it from your program:

var simplebroadcast = require('simplebroadcast');

Usage

Server side

var server = simplebroadcast.createBroadcaster();

server.listen(8000);

Client side

var client = simplebroadcast.createClient();

client.on('message', function(message) {
    // message processing
});

client.connect(port, host);

// broadcasting a message, after connection
client.on('connect', function() {
    client.write(msg);
}

Development

git clone git://github.com/ajlopez/SimpleBroadcast.git
cd SimpleBroadcast
npm install
npm test

Samples

Broadcast messages to many clients sample shows how you send and receive messages to/from many clients thru a broadcast server.

Contribution

Feel free to file issues and submit pull requests — contributions are welcome.

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.

(Thanks to JSON5 by aseemk. This file is based on that project README.md).