Introduction to XMPP

...how you can use it to build decentralised applications on the web

Lloyd Watkin

Work for Surevine

Member of the XSF + editorial team

lloyd@evilprofessor.co.uk

@lloydwatkin

lloydwatkin

Creator/lead on:
pinitto.me, XMPP-FTW, node-xmpp, buddycloud server

What is XMPP?


eXtensible Messaging and Presence Protocol
(aka Jabber)

Started around 1998

Became part of IETF in 2002

Does anyone use it?

  • Google: talk/hangouts, GCM
  • Facebook: Chat interface
  • Whatsapp: Hacked version
  • Atlassian: HipChat


Its usage is often not advertised

What is it used for?


"X"

Why are you talking
about a crusty old
protocol?

Fundamentals

Stanzas

...are snippets of XML


There are three types:
<message/>, <presence/>, & <iq/>

The JID


[user@] example.org [/mobile-phone]


  • local: The user/device (i.e. client)
  • domain: Server you are addressing
  • resource: Multiple connections?

Clients

Thin clients, leave the work to the server

Connect over TCP/BOSH (Long polling)/WebSockets

Data is pushed to clients, clients push data

Servers

Routes messages

Allow users to talk across servers

Handles authentication and security

Components

Provide extended functionality

Can send messages on behalf of clients

Server + language agnostic

Building applications with XMPP


...web-based of course

<XMHELL/>

...in the last couple of years we've attempted to make XMPP more web-developer friendly



There's also Strophe.js and node-xmpp-client

XMPP-FTW

Powerful XMPP, simple JSON

https://xmpp-ftw.jit.su/

  • Event-based system
  • Translates between XML and JSON
  • Written in nodejs
  • Attempts to make building XMPP applications really easy

What can I build???

You can build many applications with basic XMPP functionality

Components

XMPP has many other advantages

✓ 1-to-1 and multi-user chat

✓ presence (online status)

✓ roster (address book)

✓ publish subscribe

✓ federation (multi-server communications)

✓ security

✓ authentication

✓ large, helpful community

✓ well thought-out standards

Here's some interoperable webrtc demo clients from different projects:

legastero.github.io/jingle-interop-demos/

Summary

XMPP is a powerful, proven, open, secure, standards-based protocol

...great match for decentralized applications


Lots of servers/clients/libraries
(many open source)


Great helpful community, who are actively helping to push the web forward:

XMPP security days, WebRTC signalling over XMPP, New IoT extensions,
Extensions to help accessibility

Get started today

Install an XMPP server: prosody

npm i xmpp-ftw-demo

node index

open http://localhost:3000/demo

Questions


Slides available @ https://bit.ly/decentralize-xmpp

Get an XMPP account quickly: hosting.buddycloud.com