我试图简单地将XMPPPY连接到Openfire,发送一条消息,然后关闭。问题是我一直
(Python 2.6)
导入xmpp
pwd =“密码”
jid=xmpp.protocol.JID("testuser@localhost")
cl=xmpp.Client(jid.getDomain()) #,翻译为“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) #转换为“testuser”/“password”
DEBUG: sasl error Failed SASL authentification: <not-authorized />
DEBUG: sasl stop Plugging <xmpp.auth.SASL instance at 0x190f0320> out of <xmpp.client.Client instance at 0x190e5320>.我100%肯定的用户名和密码是正确的,因为我已经尝试了很多次,可以通过火花连接。
是否有什么环境是我错过的/有没有人在这方面取得成功?
发布于 2012-02-11 03:51:21
查找jid格式
jid=xmpp.protocol.JID("testuser@localhost")
xmpp服务器名应该与“@”后面的名称相同
在http://localhost:9090/index.jsp上检查xmpp服务器名
https://stackoverflow.com/questions/6696013
复制相似问题