【问题标题】:AUTHFAIL and Session timeout connecting to ejabberd with Strophe使用 Strophe 连接到 ejabberd 的 AUTHFAIL 和会话超时
【发布时间】:2015-06-16 06:52:51
【问题描述】:

我已经在 Amazon linux EC2 上安装了 ejabberd 15.03。我正在使用托管在单独实例上的外部 ODBC (MySQL)。带内注册被禁用,我有自己的脚本处理注册。设置工作正常,我可以使用像 Psi 这样的客户端连接到服务器,还可以在 android 上使用 smack 进行连接,甚至交换消息问题出在 http-bind 设置上。我正在使用 Strophe 和 Angular.js 来创建一个网络聊天客户端。这是我的 ejabbed.yml:

端口:5280 模块:ejabberd_http 请求处理程序: “/pub/archive”:mod_http_fileserver "/http-bind": mod_http_bind 网络管理员:真 http_poll: 假 http_bind: 真 ##注册:真 验证码:假

我还启用了如下模块:

mod_http_bind: []

当我使用 strophe 连接时: myapp.service('xmppAuth', function() { 返回 {

auth: function(login, password) {
console.log(login+password);
  alert('connection start');
   connect = new Strophe.Connection('http://example.com:5280/http-bind/');
   connect.connect(login, password, function (status) {
    console.log(status);
       if (status === Strophe.Status.CONNECTED) {
        alert('connected with server');
         var iq = $iq({type: 'get'}).c('query', {xmlns: 'jabber:iq:roster'});
         connect.sendIQ(iq, on_roster);
         connect.addHandler(on_roster_changed,"jabber:iq:roster", "iq", "set");
         connect.addHandler(on_message,null, "message", "chat");
              }
              else
              {
               alert(Strophe.Status);
               console.log(Strophe.Status);
              }

       })

我收到的只是状态 4,即 AUTHFAIL。知道我可能缺少什么。当我在浏览器中访问 http-bind url 时,我收到: ejabberd mod_http_bind

基于 BOSH 的 XMPP 实现 (XEP-0206)

此网页仅供参考。

要使用 HTTP-Bind,您需要一个支持它的 Jabber/XMPP 客户端。

ejabberd.log: https://drive.google.com/file/d/0B-YNcaCq5wozN0hGQ2xWUHJ0b1U/view?usp=sharing

【问题讨论】:

  • 可以贴一下日志输出吗?
  • @Sushrita 添加了访问日志文件的链接

标签: xmpp strophe


【解决方案1】:

问题已解决。错过了一些很明显的东西。 XMPP 账户密码是一个整数,我猜连接函数没有将它识别为字符串,所以不匹配和身份验证失败。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-02-06
    • 1970-01-01
    • 2016-02-17
    • 1970-01-01
    • 1970-01-01
    • 2011-10-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多