ここで与えられた答えを試しました。ここで問題を調べて、ここでこれが完全に絶望的であることを示す何かを見つけました
私はすでにopenssl(macports)のアップグレードを試み、pyopenssl(macports)のインストールを試みました。以前はmacportsで問題がありましたが、xmpppyとsleekxmppで成功しました。したがって、wokkel と Google トークの間に何らかの非互換性があるのではないかと考えなければなりません (3 番目のリンクで示唆されているように)。Google トークは (私が知る限り) 非常に人気のあるコミュニケーション手段であるため、これは奇妙に思えます。
私の質問は、2008 年以降、Google トークで wokkel の作業に成功した人がいるかどうかということです。
これは私が持っているものです:
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)