Skip to content

Instantly share code, notes, and snippets.

@wridgers
Created November 30, 2014 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wridgers/e67337ab69e3addbdb1f to your computer and use it in GitHub Desktop.
Save wridgers/e67337ab69e3addbdb1f to your computer and use it in GitHub Desktop.
Possible faye bug?
var faye = require('faye');
var client = new faye.Client('http://localhost:8000/');
client.subscribe('/test', console.log);
client.publish('/test', 'Hello world.');
undefined has published a message to /test
bidmexivn4iaz2g5uwgrroq7a4dzdad has subscribed to /test
var http = require('http'),
faye = require('faye');
var server = http.createServer(),
bayeux = new faye.NodeAdapter({mount: '/'});
bayeux.on('subscribe', function(id, channel) {
console.log(id + ' has subscribed to ' + channel);
});
bayeux.on('publish', function(id, channel, data) {
console.log(id + ' has published a message to ' + channel);
});
bayeux.attach(server);
server.listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment