我正在运行 ejabberd 安装,启用了 http-bind ,nginx代理和用于Web浏览器的迷你jappix xmpp客户端。我还有一个外部认证程序。
如果我使用经典的5222端口,我可以使用不同的资源连接此服务器上的同一用户。但是:
安装:ejabberd-2.1.10 Debian
(来自ejabberd-2.1.10-linux-x86-installer.bin,但在x86_64版本中测试了同样的问题)。
配置摘录:
{5280, ejabberd_http, [
{request_handlers,
[
{["http_bind"], mod_http_bind}
]},
%%captcha,
http_bind,
%%http_poll,
web_admin
]}
在日志上,当发生这种情况时,我有:
=INFO REPORT==== 2012-01-27 10:18:55 ===
D(<0.335.0>:ejabberd_http_bind:684) : reqlist: [{hbr,154037,
"01775ec6fc089a2b0c84abb80a4b5b7b4bdd958d",
[]},
{hbr,154036,
"01775ec6fc089a2b0c84abb80a4b5b7b4bdd958d",
[{xmlstreamelement,
{xmlelement,
"stream:features",[],
[{xmlelement,
"mechanisms",
[{"xmlns",
"urn:ietf:params:xml:ns:xmpp-sasl"}],
[{xmlelement,
"mechanism",[],
[{xmlcdata,
"PLAIN"}]}]}]}},
{xmlstreamstart,
"stream:stream",
[{"version","1.0"},
{"xml:lang","fr"},
{"xmlns","jabber:client"},
{"xmlns:stream",
"http://etherx.jabber.org/streams"},
{"id","3595609800"},
{"from",
"tchat.example.com"}]}]}]
=INFO REPORT==== 2012-01-27 10:18:55 ===
D(<0.335.0>:ejabberd_http_bind:732) : really sending now: [{xmlelement,
"auth",
[{"xmlns",
"urn:ietf:params:xml:ns:xmpp-sasl"},
{"mechanism",
"PLAIN"}],
[{xmlcdata<<"bGRhcHVzZX(...)3">>}]}]
=INFO REPORT==== 2012-01-27 10:18:55 ===
I(<0.336.0>:ejabberd_c2s:649) : ({socket_state,ejabberd_http_bind,{http_bind,<0.335.0>,{{127,0,0,1},50992}},ejabberd_http_bind}) Failed authentication for foo38@tchat.example.com
=INFO REPORT==== 2012-01-27 10:18:55 ===
D(<0.337.0>:ejabberd_http_bind:916) : OutPacket: [{xmlstreamelement,
{xmlelement,"failure",
[{"xmlns",
"urn:ietf:params:xml:ns:xmpp-sasl"}],
[{xmlelement,
"not-authorized",[],
[]}]}}]
=INFO REPORT==== 2012-01-27 10:18:55 ===
D(<0.337.0>:ejabberd_http_bind:1054) : --- outgoing data ---
<body xmlns='http://jabber.org/protocol/httpbind'><failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure></body>
这是http-bind中的“功能”吗?在激活时使其成为给定用户唯一有效的资源? 如何为同一个用户运行多个http绑定会话,如果是这样的话?任何提示?
答案 0 :(得分:1)
您的配置一定不会出现问题。我已成功使用ejabberd的http-bind很长一段时间了,当然你可以拥有多个不同资源的连接,而且可以独立于其他连接的客户端。我也使用nginx作为代理。在你ejabberd.cfg你应该:
{5280, ejabberd_http, [
http_bind,
web_admin
]}
和
{modules,[
{mod_http_bind,[]},
...
]}.
此外,在您的日志中,我看到{"from", "tchat.example.com"}
,这似乎表示配置错误。