node-rayo is a node client for the popular Rayo protocol
Installation
To install and use node-rayo, use npm:
$ npm install node-rayo
Dependencies
node-rayo depends on the jab xmpp library which has some native dependencies for XML processing.
Ubuntu/Debian
sudo apt-get install libexpat1 libexpat1-dev libicu-dev -y
Fedora/Red Hat
sudo yum install expat expat-devel libicu libicu-devel -y
Windows
Download and install this file
Mac OSX
curl -O http://surfnet.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
tar xzvf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure
make
make check
sudo make install
cd ..
source /etc/profile
Usage
Include node-rayo:
var rayo = ;
To get started, create a connection with rayo.Connection()
:
conn = host: 'prism.host.com' jabberId: 'youruser@jabber.org' jabberPass: 'pass' debug: false ping: true ;
You can then use conn.create()
to create a Rayo command:
dial = conn;
Once your command is created, you can listen to events specific to that command:
dial;dial;
And then send that command (note dial, component and mixer commands require command.listen(cmd.id);
to wire up event handlers):
return conn;
Finally, connect!
conn;
Examples
You can view more complete examples in both CoffeeScript and JavaScript in the examples folder.