XMPP 在身份验证时出错

XMPP get error while authentication

我正在使用 xmpppy 库与 XMPP 服务器连接...我能够与服务器连接,但在身份验证时出现错误 "Plugging ignored: another instance already plugged."

这个错误是什么意思,我该如何解决?

In [37]: c.isConnected()
Out[37]: ''

In [38]: jid = xmpp.protocol.JID('gathole@localhost')

In [39]: c.auth(jid.getNode(),'password', resource=jid.getResource())
DEBUG: sasl         start Plugging <xmpp.auth.SASL instance at 0x108fc2710> into <xmpp.client.Client instance at 0x109003c68>
DEBUG: sasl         error Plugging ignored: another instance already plugged.
Traceback (most recent call last):
  File "/Users/gathole/.virtualenvs/driveu/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 459, in interact
    line = self.raw_input(prompt)
  File "/Users/gathole/.virtualenvs/driveu/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 528, in raw_input
    line = py3compat.cast_unicode_py2(self.raw_input_original(prompt))
KeyboardInterrupt
DEBUG: gen_auth     start Plugging <xmpp.auth.NonSASL instance at 0x108fc2710> into <xmpp.client.Client instance at 0x109003c68>
DEBUG: gen_auth     error Plugging ignored: another instance already plugged.
Traceback (most recent call last):
  File "/Users/gathole/.virtualenvs/driveu/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 459, in interact
    line = self.raw_input(prompt)
  File "/Users/gathole/.virtualenvs/driveu/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 528, in raw_input
    line = py3compat.cast_unicode_py2(self.raw_input_original(prompt))
KeyboardInterrupt

它需要更改 XMPP ejabberd 服务器配置。在 ejabberd.cfg 文件中将行 {hosts, ["localhost"]} 更改为 {hosts, ["localhost", "server-domain", "server-ip-address"]}。 重启服务器,在新hosts下新建一个用户,服务器域名或者服务器ip。