agora
dead simple websocket communication module.
Stream JSON data easily with events between clients and server. You can broadcast to all clients, or just one.
runs in node and in the browser with browserify!
It's basically a simple wrapper built around the awesome module emit.io
install
npm install agora
server example
var Server = Server; var server = port: 8000; server; /* or emit to everyone! */;
client example
var Client = Client;var client = ; /* * once we get the ready event from the server, * we're good to go! we can now start emitting * and the server will hear the events! */client; /* * once you've built your server API, you can * listen to events. Here we've set up * an addResult event. */client; client; /* connect the client! */client;
methods
var Signals = ;
var server = new Signals.Server(opts)
Creates a new instance of a websocket server.
opts.port
| specify the port number int
var client = new Signals.Client()
Creates a new instance of a websocket client.
client.connect(address)
Connects to the websocket server at the provided address
| String.
license
MIT