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

ejabberd server logs show accepted connection but xmpp client shows no response from server

我最近在 macOS X 10.7 上安装了 ejabberd 服务器。服务器似乎 运行 正常,可以使用 http://abc.example.com:5280/admin.

通过互联网访问管理页面

我在 android phone 中安装了 "simple XMPP client"、"ChatSecure" 和其他 xmpp 聊天客户端以连接到我的 ejabberd 服务器。他们都失败了。当我尝试连接时,我可以在 ejabberd 日志中看到以下行

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 聊天客户端上登录超时。不确定是什么导致了这个问题。当我在 ejabberd 服务器为 运行 的同一个盒子上安装类似的 xmpp 客户端并尝试使用 bob@abc.example.com 连接时,它工作正常。

仅当我使用某些远程计算机或 phone 时才会出现此问题。即使请求到达 ejabberd 服务器,登录也不起作用。

请帮忙


根据 raymond

的以下建议更新了 post

嗨,雷蒙德

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

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 客户端连接时 运行,它的工作和下面是 it.I 的日志片段当我没有得到 "Auth" 行时尝试通过互联网使用远程机器或 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>">>

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

要验证这个假设,您应该:

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