首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在google talk中使用wokkel:(error twisted.words.protocols.jabber.sasl.SASLNoAcceptableMechanism)

如何在google talk中使用wokkel:(error twisted.words.protocols.jabber.sasl.SASLNoAcceptableMechanism)
EN

Stack Overflow用户
提问于 2012-03-30 10:52:38
回答 1查看 623关注 0票数 1

我给出了here的答案。查找问题here,发现这是完全没有希望的here

我已经尝试升级我的openssl (macports),并尝试安装pyopenssl (Macports)。尽管我以前在使用macports时遇到过问题,但我已经成功地使用了xmpppy和sleekxmpp。因此,我不得不怀疑wokkel和google talk之间是否存在某种不兼容(如第三个链接中所建议的)。这对我来说似乎很奇怪,因为google talk (据我所知)是一种非常流行的交流媒介。

我的问题很简单,自2008年以来,是否有人成功地让wokkel与google talk合作,如果是,是如何做到的?

这就是我所拥有的:

代码语言:javascript
复制
from twisted.words.xish import domish
from wokkel.xmppim import MessageProtocol, AvailablePresence

class EchoBotProtocol(MessageProtocol):
  def connectionMade(self):
      print "Connected!"

      # send initial presence
      self.send(AvailablePresence())

  def connectionLost(self, reason):
      print "Disconnected!"

  def onMessage(self, msg):
      print str(msg)

      if msg["type"] == 'chat' and hasattr(msg, "body"):
          reply = domish.Element((None, "message"))
          reply["to"] = msg["from"]
          reply["from"] = msg["to"]
          reply["type"] = 'chat'
          reply.addElement("body", content="echo: " + str(msg.body))

          self.send(reply)

from twisted.application import service
from twisted.words.protocols.jabber import jid
from wokkel.client import XMPPClient

application = service.Application("echobot")

xmppclient = XMPPClient(jid.internJID("someuser@example.com/echobot"), "pass")
xmppclient.logTraffic = False
echobot = EchoBotProtocol()
echobot.setHandlerParent(xmppclient)
xmppclient.setServiceParent(application)
EN

回答 1

Stack Overflow用户

发布于 2013-04-06 15:05:13

我能够通过安装pyOpenSSL来解决这个问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9936383

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档