[英]How to configure Autobahn(crossbar.io) for dynamic chat rooms?
I love crossbar.io and how it works(personally). 我喜欢crossbar.io以及它是如何工作的(个人)。 But I would like to know how we could setup the architecture for a typical dynamic chat application using Autobahn(Crossbar.io). 但我想知道如何使用Autobahn(Crossbar.io)为典型的动态聊天应用程序设置架构。
Dynamic chat here means, individual chat room created for each url. 这里的动态聊天意味着为每个网址创建了单独的聊天室。
For example: http://www.myapplication.com/chat?roomId=123
, creates a chat room subscribing to topic "com.myapp.chat123" . 例如: http://www.myapplication.com/chat?roomId=123
: //www.myapplication.com/chat?roomId = 123 ,创建一个订阅主题“com.myapp.chat123”的聊天室。
http://www.myapplication.com/chat?roomId=456
, creates a chat room subscribing to topic "com.myapp.chat456" . http://www.myapplication.com/chat?roomId=456
,创建一个订阅主题“com.myapp.chat456”的聊天室。
We need to store the chat messages in the Database for future reference, since Autobahn doesn't have message persistence. 我们需要将聊天消息存储在数据库中以供将来参考,因为高速公路没有消息持久性。
Now my questions are: 现在我的问题是:
If each chat room use separate topic, then how we could subscribe for the messages in the server(since we can't subscribe using Patterns as of now) ? 如果每个聊天室使用单独的主题,那么我们如何订阅服务器中的消息(因为我们现在无法使用模式订阅)?
Since we will use separate topic for each room, how we do authentication and authorization in Crossbar.io ? 由于我们将为每个房间使用单独的主题,我们如何在Crossbar.io中进行身份验证和授权?
I couldn't able to find the Javascript documentation for setting the features as mentioned here . 我无法找到用于设置此处提到的功能的Javascript文档。 Where to find it ? 哪里可以找到它?
In this SO answer , it was mentioned that crossbar.io provides meta-events for session join or leave on Router . 在这个SO答案中 ,有人提到crossbar.io为会话加入或离开路由器提供元事件。 Is there any way to know when user subscribes or unsubscribes to specific topic instead of Router join or leave ? 有没有办法知道用户何时订阅或取消订阅特定主题而不是路由器加入或离开?
Could you explain how to configure available advanced profile features with Current version of Crossbar.io (in Javascript, browser or Node.js) ? 您能解释一下如何使用当前版本的Crossbar.io(在Javascript,浏览器或Node.js中)配置可用的高级配置文件功能吗?
Could you explain about Event History feature in detail ? 你能详细解释一下事件历史功能吗? And how to configure it ? 以及如何配置它?
I'll answer your question one by one: 我将逐一回答你的问题:
Authentication / Authorization process has nothing to do with a separate topic. 身份验证/授权过程与单独的主题无关。 You can do something like that: 你可以这样做:
I know that Autobahn is hard to follow sometimes due to the documentation, but examples can help a lot, and here there are a lot of interesting things: https://github.com/crossbario/crossbarexamples (including Authentication, MetaAPI, Patterns). 我知道由于文档的原因,高速公路有时难以遵循,但是示例可以提供很多帮助,这里有很多有趣的东西: https : //github.com/crossbario/crossbarexamples (包括身份验证,MetaAPI,模式) 。
I hope that I've answered most of your questions, but yet, if there are things you don't understand, I recommend you to go to the mailing list , this is your best try, in my opinion. 我希望我已经回答了你的大部分问题,但是,如果有些事情你不明白,我建议你去邮件列表 ,这是你最好的尝试,在我看来。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.