문제

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

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top