使用 strophe js 的基于 Javascript 的 XMPP 聊天客户端 - 示例和教程?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17261076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Javascript based XMPP chatclient using strophe js - Examples and tutorials?
提问by REJH
I want to make a simple javascript-based XMPP client. I stumbled upon 'strophe js', which should make my life easier when it comes to XMPP but I find the documentation a bit.. uncomplete. It has an example on how to connect/disconnect but that's pretty much it.
我想制作一个简单的基于 javascript 的 XMPP 客户端。我偶然发现了 'strophe js',它应该让我在 XMPP 方面的生活更轻松,但我发现文档有点......不完整。它有一个关于如何连接/断开连接的示例,但仅此而已。
I need to get a list of contacts, send and receive messages... how do I do this?
我需要获取联系人列表、发送和接收消息...我该怎么做?
Actually: where can I find a tutorial or an example on how to do this? (no need to write a full tut here :)
实际上:我在哪里可以找到有关如何执行此操作的教程或示例?(不需要在这里写一个完整的 tut :)
回答by Kishan Patel
You can find your requirement related to chat using stropher js for XMPP protocolon this below working github code.
您可以在下面的工作 github 代码中找到与使用stropher js 进行 XMPP 协议聊天相关的要求。
https://github.com/metaHyman/profxmpp
https://github.com/metaHyman/profxmpp
Look on chap :06 demo (GAB Tut).
查看第 06 章演示 (GAB Tut)。
It will satisfy all your requirement related to
它将满足您的所有相关要求
- one to one chat.
- Roster list (Friend list),
- Send friend request,
- In coming request approval.
Start one to one chat etc...
and all important demo also included
- 一对一聊天。
- 花名册(好友列表),
- 发送好友请求,
- 在即将请求批准。
开始一对一聊天等...
还包括所有重要的演示
Let me know you have any query in this demo. :) :)
让我知道您在此演示中有任何疑问。:) :)
回答by Sankalp Singha
Check out this project : https://conversejs.org/
看看这个项目:https: //conversejs.org/
This is a really good implementation of using Strophe.js and also uses Backbone Js to to ease it up. Hope it helps.
这是使用 Strophe.js 的一个非常好的实现,并且还使用 Backbone Js 来简化它。希望能帮助到你。