Faye

Simple pub/sub messaging for the web

What is it?

Faye is a publish-subscribe messaging system based on the Bayeux protocol. It provides message servers for Node.js and Ruby, and clients for use on the server and in all major web browsers.

It also includes a solid set of tools for easily building plain WebSocket servers and clients, compatible with a wide range of protocol versions.

Who uses it?

1. Start a server

var Faye   = require('faye'),
    server = new Faye.NodeAdapter({mount: '/'});

server.listen(8000);

2. Create a client

var client = new Faye.Client('http://localhost:8000/');

client.subscribe('/messages', function(message) {
  alert('Got a message: ' + message.text);
});

3. Send messages

client.publish('/messages', {
  text: 'Hello world'
});