Created
November 30, 2014 02:30
-
-
Save wridgers/e67337ab69e3addbdb1f to your computer and use it in GitHub Desktop.
Possible faye bug?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var faye = require('faye'); | |
var client = new faye.Client('http://localhost:8000/'); | |
client.subscribe('/test', console.log); | |
client.publish('/test', 'Hello world.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
undefined has published a message to /test | |
bidmexivn4iaz2g5uwgrroq7a4dzdad has subscribed to /test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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