A pusher like nodejs implementation built on top of socket.io(http://socket.io/), to build real time apps.
It is a self hosted replacement of pusher.
It is in beta and not production ready yet.
Dependencies: Node.js(http://nodejs.org/)
socket.io(http://socket.io/)
express js(http://expressjs.com/)
After installing the above download the narad code, and cd into the narad folder.
Open the file public/narad.js and replace your host in the 2nd line
narad.url = 'http://192.168.0.46:3000'; // replace 192.168.0.46 with your host
node server.js
Sent post request to
/publish/:channel_name/:event_name data = {}
include the following javascript files at client
replace host:port by the host and port where you would run naiad
<script src="host:port/socket.io/socket.io.js"></script>
<script src="host:port/narad.js"></script>
var channelName = "event";
var eventName = "chat_room"
var channel = narad.subscribe(channelName);
channel.bind(eventName, function (data) {
console.log("data: ", data);
});
use the forever library
npm install forever -g
(https://github.com/nodejitsu/forever)
in the narad directory
forever start server.js
forever stop server.js
publishing from client
configuring the host url
Adding npm
do not pollute the global namespace
add custom port
Securtiy: Channel authentication
Scalability
Logging