From: Nanda K. <nan...@ya...> - 2012-10-20 18:32:49
|
Hi All, I am having difficulty in establishing a connection with XMPP (Prosody) . But if I use PSI it works fine and request for your suggestions. Here is the code snippet of my python : username = conf_parser.get("xmpp", "user") passwd = conf_parser.get("xmpp", "password") host = conf_parser.get("xmpp", "host") muc = conf_parser.get("xmpp", "muc") port = conf_parser.get("xmpp", "port") client = xmpp.Client(host) client.connect(server=(host,port)) client.auth(username, passwd,resource='', sasl=1) client.sendInitPresence() In debug mode : DEBUG: dispatcher warn Registering protocol "error" as <class 'xmpp.protocol.Protocol'>(http://etherx.jabber.org/streams) DEBUG: socket sent <?xml version='1.0'?> <stream:stream xmlns="jabber:client" to="localhost" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" > DEBUG: socket error Socket error while receiving data Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/xmpp/transports.py", line 161, in receive try: received = self._recv(BUFLEN) error: [Errno 104] Connection reset by peer DEBUG: client stop Disconnect detected DEBUG: socket error Socket operation failed Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/xmpp/transports.py", line 161, in receive try: received = self._recv(BUFLEN) error: [Errno 104] Connection reset by peer DEBUG: socket error Socket error while receiving data DEBUG: client stop Disconnect detected Prosody logs : Oct 20 23:46:39 c2s94ba718 info Client connected Oct 20 23:46:39 c2s94ba718 info Client disconnected: ssl handshake failed Oct 20 23:46:39 c2s94ba718 info Destroying session for (unknown) ((unknown)@(unknown)) Oct 20 23:48:57 c2s96052a0 info Client connected Oct 20 23:48:57 c2s96052a0 info Client disconnected: ssl handshake failed Oct 20 23:48:57 c2s96052a0 info Destroying session for (unknown) ((unknown)@(unknown)) Cheers, Nandu |