带Openfi的xmppy

2024-05-23 18:30:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着简单地将xmppy连接到Openfire,发送一条消息,然后关闭。问题是我总是

(Python 2.6)

import xmpp

pwd = "password"

jid=xmpp.protocol.JID("testuser@localhost")

cl=xmpp.Client(jid.getDomain()) #which translates to 'localhost'

cl.connect()

DEBUG: socket       start Plugging <xmpp.transports.TCPsocket instance at 0x190ea1b8> into <xmpp.client.Client instance at 0x190e5320>

DEBUG: socket       start Successfully connected to remote host ('localhost', 5222)

DEBUG: dispatcher   start Plugging <xmpp.dispatcher.Dispatcher instance at 0x190ea2d8> into <xmpp.client.Client instance at 0x190e5320>

cl.auth(jid.getNode(),pwd) #translates to 'testuser' / 'password'

^{pr2}$

我100%确定用户名和密码是正确的,因为我已经尝试了很多次,可以通过Spark连接。在

有没有一个地方是我缺少的/有人在这方面取得了成功?在


Tags: toinstancedebugclientlocalhostclpwdxmpp