Python을 사용하여 XMPP 메시지를 보내려고하지만 작동하지 않습니다. 인증 단계에서 실패한 것 같습니다. 이전 질문에서이 예를 취하고 테스트 용 Gmail 계정을 설정했습니다.Python을 사용하여 XMPP 메시지 보내기
import xmpp
username = '[email protected]'
passwd = 'ThePass123'
to='[email protected]'
msg='hello :)'
client = xmpp.Client('gmail.com')
client.connect(server=('talk.google.com',5223))
client.auth(username, passwd, 'botty')
client.sendInitPresence()
message = xmpp.Message(to, msg)
message.setAttr('type', 'chat')
client.send(message)
이 디버그 출력을 많이입니다하지만 그것이
DEBUG: socket sent <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">cmFuZG9tdGVzdDYwM0BnbWFpbC5jb21AZ21haWwuY29tAHJhbmRvbXRlc3Q2MDNAZ21haWwuY29tAFRoZVBhc3MxMjM=</auth>
DEBUG: socket got <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<invalid-authzid/>
</failure>
</stream:stream>
DEBUG: dispatcher ok Got urn:ietf:params:xml:ns:xmpp-sasl/failure stanza
DEBUG: dispatcher ok Dispatching failure stanza with type-> props-> [u'urn:ietf:params:xml:ns:xmpp-sasl'] id->None
DEBUG: sasl error Failed SASL authentification: <invalid-authzid />
실패하지만 나는 또한 내가 이것을 시도했습니다
DEBUG: socket sent <presence id="2" />
DEBUG: socket sent <message to="[email protected]" type="chat" id="3">
<body>hello :)</body>
</message>
끝이 저에게 알려주는 부분입니다 xmpppy 및 sleekxmpp와 같은 결과를 얻습니다. 이 분야는 새로운 것이므로 초보자 실수를 저 지르지는 못합니다.
감사
어떤 XMPP 모듈을 사용하고 있습니까? –