Pergunta

I am using node.js with Faye for implementing a comet solution. Right now,i have the code for node.js server file to publish data on a channel. But, I have a need where i need to send the channel name to the node.js server side code as an argument and the server then publishes data on that particular channel.

How can i do this ? Any ideas will be appreciated

Thanks

Foi útil?

Solução

I have found out how to do it. You have to send a HTTP request like this and send it to the Faye server

{"channel":"/the/channel","data":{"the":"message"}}

This will publish the message in /the/channel

Thanks to Alfred for his response as well

Outras dicas

This is not precisly the answer to your question, but I would still advice you to check out socket.io. Socket.io is more actively developed (right now) and also has a rooms(version 0.7.x) concept. See image below for example.

rooms

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top