Tuesday, June 12, 2018

Goodbye XMPP. Hello IRC

Up until 2 years ago, my wife and kids and I stayed in touch with Google Hangouts.  I disliked being dependent on a third party, being unable to program the system to match our needs, and not having access to it on all the devices we care about, so we switched to XMPP.  It was an improvement and has served us well for the last couple years.

A couple months ago, we started seeing large delays in message delivery times.  We were also getting extended, repeated disconnects from the XMPP server.  Our messaging stack is selfhosted and open source, so I prepared for a debugging session.  As I got ready to dive in, I had a nagging feeling that there was way too much code at play here.  We ran Prosody, which is a great XMPP server, but it's 35k lines of code.  My SMS to XMPP gateway adds another 1k.  All we wanted to do was send small pieces of text between 7 people and set up some chat rooms.  That much code felt like overkill.

After a few hours work and 500 lines of Go, I had a custom IRC server with a built in BNC.  With another 200 lines, I had a working SMS to IRC gateway, so I can send and receive SMS from my IRC clients.  Obviously, setting up chat rooms was painless.

We had some minor glitches during initial deployment, but because the whole system is so small, it was a cinch to debug and repair.  It's been really solid since then.  The minimalism is refreshing.

The code is available in case you're interested. It won't compile by itself since it's part of a larger family server (git, movies, personal assistant, Asterisk dialplan, etc).

No comments: