node.js and juggernaut pub/sub
I'm using express framework and juggernaut. I looked at many examples about juggernaut, a开发者_高级运维ll examples using this method(client side):
var jug = new Juggernaut;
jug.subscribe("channel_name", function(data){
console.log("Got data: " + data);
});
Is it secure? I don't think so, everybody can subscribe to a channel from javascript console. Is there a way to subscribe a channel from server side?
Use security through obscurity, use a random channel name (HMAC).
I don't know how Juggernaut works, but I know that Faye supports extensions that can include authentication, so that subscribe operations require a valid token. See: http://faye.jcoglan.com/node.html
It would be worth checking whether Juggernaut supports a similar extension/intercept model.
精彩评论