xmpp - 使用 Strope 匿名登录 Openfire

标签 xmpp openfire strophe

我正在运行 openfire 3.6.4 并与 Strope 库连接。设置工作正常。现在我想做一件事,我想要为我的应用程序进行匿名登录,并且该登录还应该订阅一个房间并接收该房间的通知。我已经在 openfire 中启用了匿名设置。

最佳答案

首先,通过将 null 作为用户名和密码传递给 connect(),在 Strope 中启用 SASL ANONYMOUS:

connection.connect(null,
                   null,
                   onConnect);

接下来,只需将状态发送至 room@conference_service/nick:

var pres = $pres({to: 'room@conference_service/nick'});
connection.send(pres);

关于xmpp - 使用 Strope 匿名登录 Openfire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5114259/

相关文章:

erlang - 如何测试ejabberd内部和外部组件

java - 用于客户端通知的 AMQP 或 XMPP

java - 为什么向 User-B 注册的数据包监听器不起作用?

ios - xmpp如何向离线用户发送推送通知

javascript - XEP-0077 使用 Strophe.js 和 openfire 进行带内注册

xmpp - 用于群聊的 Hangouts 服务器 (XMPP)

python - Jabber bot - 如何获取状态更新?

ios - 向 ios 发送推送通知以与离线用户聊天,openfire xmpp

javascript - 使用 attach() 时 Strophe 中的 404(无效的 SID 值)

xmpp - 营养不良 MUC 示例