XMPPPY 与 Openfire
我试图简单地将 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% 确定用户名和密码是正确的,因为我已经尝试了很多次并且可以通过 Spark 连接。
是否有我缺少的设置/有人在这方面取得了成功吗?
I'm trying to simply connect XMPPPY to Openfire, send a message, then close. The problem is that I keep getting
(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'
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>.
I'm 100% sure that the username and password are correct as I've tried many times and can connect via Spark.
Is there a setting somewhere that I'm missing / has anyone has success with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查找您的 jid 格式
jid=xmpp.protocol.JID("testuser@localhost")
xmpp 服务器名称应与“@”后的名称相同
检查 xmpp 服务器名称 http://localhost:9090/index.jsp
lookup your jid format
jid=xmpp.protocol.JID("testuser@localhost")
the xmpp server name should same as name after '@'
check the xmpp server name at http://localhost:9090/index.jsp