代码之家  ›  专栏  ›  技术社区  ›  Kartik Patel

ejabberd服务器日志显示接受的连接,但xmpp客户端没有显示来自服务器的响应

  •  0
  • Kartik Patel  · 技术社区  · 10 年前

    我最近在macos X 10.7上安装了ejabbed服务器。该服务器似乎运行良好,可以使用 http://abc.example.com:5280/admin .

    我在android手机中安装了“简单XMPP客户端”、“ChatSecure”和其他XMPP聊天客户端,以连接到我的ejabbed服务器。所有这些都失败了。当我尝试连接时,我可以在射精日志中看到以下行

    2015-07-29 23:28:58.380 [info] <0.573.0>@ejabberd_listener:accept:299 (#Port<0.7250>) Accepted connection 182.70.123.139:55402 -> 192.168.1.4:5280
    2015-07-29 23:37:51.844 [info] <0.571.0>@ejabberd_listener:accept:299 (#Port<0.7277>) Accepted connection 182.70.123.139:10751 -> 192.168.1.4:5222
    

    然而,xmpp聊天客户端上的登录超时。不确定导致此问题的原因。当我在运行ejabbed服务器的同一个机器上安装类似的xmpp客户端并尝试使用bob@abc.example.com,工作正常。

    只有当我使用远程机器或电话时,问题才会出现。即使请求到达ejabbed服务器,登录也无法正常工作。

    请帮忙


    更新后的帖子来自雷蒙德的以下建议

    嗨,雷蒙德

    以下是调试模式后更新的日志。它卡在最后一行。请提出建议。

    2015-07-30 21:16:46.450 [info] <0.566.0>@ejabberd_listener:accept:299    (#Port<0.7012>) Accepted connection 1.39.10.237:46913 -> 192.168.1.4:5222
    2015-07-30 21:16:46.889 [debug] <0.586.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<stream:stream to=\"abc.example.com\" xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">">>
    2015-07-30 21:16:46.889 [debug] <0.587.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='129956901' from='abc.example.com' version='1.0' xml:lang='en'>">>
    2015-07-30 21:16:46.890 [debug] <0.587.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='5m6LdO+13BLJZeS37oD5PF54bGY='/><register xmlns='http://jabber.org/features/iq-register'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
    

    当我尝试在ejabberd运行的同一台机器上使用xmpp客户端进行连接时,它的工作情况如下:。当我试图通过互联网使用远程机器或android设备连接时,我没有得到“认证”线路。

    2015-07-30 21:47:46.149 [info] <0.566.0>@ejabberd_listener:accept:299 (#Port<0.7017>) Accepted connection 182.70.123.139:55949 -> 192.168.1.4:5222
    2015-07-30 21:47:46.150 [debug] <0.617.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream to=\"abc.example.com\" xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">">>
    2015-07-30 21:47:46.150 [debug] <0.618.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1273758616' from='abc.example.com' version='1.0' xml:lang='en'>">>
    2015-07-30 21:47:46.152 [debug] <0.618.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='5m6LdO+13BLJZeS37oD5PF54bGY='/><register xmlns='http://jabber.org/features/iq-register'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
    2015-07-30 21:47:46.156 [debug] <0.617.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"DIGEST-MD5\">dXNlcm5hbWU9ImFkbWluIixyZWFsbT0iY2hhdC52b3Rlc3VwLmNvbSIsbm9uY2U9IjM3OTYwNjcwNDYiLGNub25jZT0iQitjNDNpZkZ1d3NvN2JzYXRrMGRGT3N6dDJNTGhrZ2o3YkF2bWJGVyt3Yz0iLG5jPTAwMDAwMDAyLHFvcD1hdXRoLG1heGJ1Zj02NTUzNixkaWdlc3QtdXJpPSJ4bXBwL2NoYXQudm90ZXN1cC5jb20iLHJlc3BvbnNlPWE0Nzg1MTc2ZGE0MzdkOWYyNzBmMjhmODc5ZmZhYjQx</auth>">>
    
    1 回复  |  直到 10 年前
        1
  •  1
  •   Mickaël Rémond    10 年前

    如果连接速度很慢(超时),可能是因为运营商降低了端口5222上的流量。

    为了验证这一假设,您应该:

    • 使用ejabbed调试日志级别查看协商是否正在进行(甚至缓慢)。
    • 尝试用纯SSL连接端口5223,看看是否更快。
    • 尝试在另一个端口(如443)上运行ejabberd,这不太可能被移动提供商减慢。