我正在与这个问题“争斗”超过3天,并且只搜索了我能想到的所有相关内容。
所以,我想设置Strophe和Ejabberd以创建一个基本的聊天应用程序。我面临的问题是每当我尝试将Strophe连接到XMPP服务器时 - 它都保持状态CONNECTING。如果我使用Apache / Nginx代理 - 我得到502代理错误。
upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST /http-bind HTTP/1.1", upstream: "http://127.0.0.1:5280/http-bind"
如果我在flXHR的帮助下使用直接连接到http-bind - 浏览器中没有任何反应。只是保持在CONECTING状态。
我遇到这个问题的机器有Fedora 12和Ejabberd 2.1.4
在ejabberd.log中我有这个:
=INFO REPORT==== 2010-07-15 14:41:55 ===
D(<0.831.0>:ejabberd_http_bind:1105) : --- incoming data ---
<body rid='2423401616' xmlns='http://jabber.org/protocol/httpbind' to='localhost' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
--- END ---
=INFO REPORT==== 2010-07-15 14:41:55 ===
D(<0.831.0>:ejabberd_http_bind:117) : Starting session
=INFO REPORT==== 2010-07-15 14:41:55 ===
D(<0.832.0>:ejabberd_http_bind:294) : started: {"2e62ed526291d8b55024cbaa9698164715e70026",
[],
{{127,0,0,1},45679}}
=INFO REPORT==== 2010-07-15 14:41:55 ===
I(<0.833.0>:ejabberd_net:25) : gethostname {socket_state,ejabberd_http_bind,
{http_bind,<0.832.0>,
{{127,0,0,1},45679}},
ejabberd_http_bind}
=INFO REPORT==== 2010-07-15 14:41:58 ===
D(<0.369.0>:ejabberd_receiver:320) : Received XML on stream = " "
=INFO REPORT==== 2010-07-15 14:42:00 ===
D(<0.832.0>:ejabberd_http_bind:531) : terminate: Deleting session 2e62ed526291d8b55024cbaa9698164715e70026
=INFO REPORT==== 2010-07-15 14:42:00 ===
D(<0.832.0>:ejabberd_http_bind:532) : terminate: _Reason normal
=INFO REPORT==== 2010-07-15 14:42:00 ===
D(<0.831.0>:ejabberd_http_bind:237) : got pid: <0.832.0>
=INFO REPORT==== 2010-07-15 14:42:00 ===
D(<0.831.0>:ejabberd_http_bind:267) : Create session: "2e62ed526291d8b55024cbaa9698164715e70026"
=INFO REPORT==== 2010-07-15 14:42:00 ===
D(<0.831.0>:ejabberd_http_bind:789) : Looking for session: "2e62ed526291d8b55024cbaa9698164715e70026"
事实上,在Ubuntu 10.4上使用相同的设置(相同的javascript / html和相同的ejabberd.cfg)没有问题。我发现工作和不工作设置之间存在两个差异。首先,在Ubuntu机器上我有ejabberd 2.1.2-2,而在有问题的Fedora机器上它是2.1.3(我试过和2.1.4)。其次,在它运行的机器上,日志中没有“gethostname”和“terminate:Deleting session”。所以我猜问题是“删除会话”并且与“gethostname”有关,但是我没有足够的经验来解决这个问题。
任何关于如何进一步调试的帮助或线索将不胜感激。提前谢谢。