[ale] XMPP for Python or sending messages from CLI

Alex Carver agcarver+ale at acarver.net
Mon Dec 24 19:35:21 EST 2018


On 2018-12-24 14:50, Jason van Gumster wrote:
> 
> 
> On December 23, 2018 12:44:23 PM EST, Alex Carver via Ale <ale at ale.org> wrote:
>> I can not find an updated/working/recent XMPP library for Python 2.
>> I've already tried xmpppy and sleekxmpp with no success.  
> 
> Can you be a bit more specific when you say "with no success"? Is there an error or somesuch? I've been using xmpppy for a while without much issue. It feels a bit dated, but it *should* still work. What's the XMPP server you're using? Also, what authentication method is it using?
> 

I was trying to connect to a Prosody server but I would get timeouts
when connecting.  Prosody's default is plain authentication with SSL
optional.  I have SSL enabled with a self created certificate.  I have
several other clients connecting to the server and working so there
doesn't seem to be a problem with Prosody's configuration at this time
but I could be wrong if there's something very subtle that xmpppy
doesn't like.

I was manually trying everything within ipython first so I don't have it
scripted yet.  The basic attempt to connect was the following that
diectly followed the example at http://xmpppy.sourceforge.net/basic.html

import xmpp (provided by xmpppy)
jidparams = {}
jidparams['jid'] = "notifier at acarver.net"
jidparams['password'] = "notifier_password"
jid = xmpp.protocol.JID(jidparams['jid'])
client = xmpp.Client(jid.getDomain(), debug=[])
client.Server = "prosody_server_fqdn"
client.connect()
client.auth(jid.getNode(), jidparams['password'])

I could never get a connection established.  I tried multiple different
forms of the client.connect method including specifying the server,
port, etc.  It never indicated that the connection didn't work but I
couldn't do anything with the connection.  Things like setting presence
didn't work.  I had another client under separate login running with the
notifier account added as a friend to check for the presence but that
never did anything.  Sending messages (which xmpppy claims presence
isn't required) didn't work either.


More information about the Ale mailing list