Faye 和 Nodejs:如何运行 Faye 服务器端客户端?
我正在尝试开发一个 Faye 服务器端客户端以根据需要自动运行。在Faye的官方网站上,我只找到了关于服务器端客户端的文档,没有关于如何运行它的信息。 请告诉我该怎么做 谢谢
I'm trying to develop a Faye server side client to run automatically as needed. In the official website of Faye, I find only document about server side client, there is no information about how to run it.
Please tell me how to do so
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
文档中缺少一个关键部分。看来您需要调用
client.connect()
才能接收事件。这对我有用:
There's a key missing piece in the documentation. It appears you need to call
client.connect()
in order to receive events.Here is what worked for me:
刚刚通过谷歌偶然发现了这一点。您应该能够仅使用以下代码运行客户端:
如果您仍然遇到问题,请访问邮件列表 http://groups.google.com/group/faye-users
just stumpled on this through Google. You should be able to run a client using just this code:
If you still have trouble, please get on the mailing list at http://groups.google.com/group/faye-users
创建一个 .rb 文件并填充以下代码
转到控制台并键入
Once you do.使用 html 创建一个 js,如下所示:
我想你已经准备好了。 :)
Create a .rb file and fill with following code
Go to console and type
Once you have done. create a js with html as following :
And I think u r ready to go. :)