wtf is xmpp?
DESCRIPTION
An small introduction to XMPP focusing on non-instant messaging usesTRANSCRIPT
WTF is XMPPPedro Melo <{xmpp,mailto}:[email protected]>
XMPP
• Almost 10 years old
• IETF standard (RFC 3920 & RFC 3921)
• More than 100 extensions
• Started as Jabber: XMPP is the protocol powering Jabber Instant Messaging Network
Who uses it?
• SAPO
• GTalk
• Jabber.TLD
• Yahoo! (the Video conference site)
• AIM (private interconnects)
• US DoD (big BIG users), UK Armed Forces
So really, WTF is XMPP?
• XML Streams: send small XML stanzas
• Simple building blocks
• Extensible: add your stuff, no need to ask permission
• Secure (TLS security is mandatory, CA available with free certificates)
• Federated
Building Blocks
• <presence>, <message>, <iq>
• update your own state on the network
• chat, notify others
• query/response interface - almost REST
• More advanced: capability discovery, publish/subscribe, negotiate out-of-band channels (VoIP, E2E encryption)
Extensible
• Any building block can be extended
• Just add a new child XML element with your own XML namespace
• No need to ask anyone
• But be polite and only send them to people who will understand it
Federated
• Each user has unique JID (Jabber ID)
• local_name@domain
• Each active connection gets a resource
• local_name@domain/resource
• Domains find to each other using DNS SRV records, connect using secure TLS
A XMPP NetworkZee Big Picture
But this is IM...
XMPP = IM . C2
XMPP = IM . C2
Because bots talks at light-speed :)
Bots
• Bots are the initial first step to build a XMPP presence
• Notifications
• Include Atom alternative payload
• Interaction with a service
• Text-based command line-style
So how do I start?
First, pick a Server
• Install your own server
• Allows you to use your own domain/brand
• Two choices:
• ejabberd
• OpenFire
• Personally I use ejabberd and djabberd
Second, pick a library
• Do not try to build one yourself :)
• Python: use Twisted XMPP (Worlds)
• Perl: Net::XMPP2 (soon AnyEvent::XMPP)
• Ruby: I don’t like any of them :)
Third, start coding
But how do I connect to the XMPP network?
We got some great opportunities for you today
C2S vs Components
• C2S bots are simple to start and play
• Components are the only way to fly long term
• Zero protocol limitations if you use a Component
• With ejabberd you have component load-balancing built-in (plus clustering bonus)
That’s it
But lets talk about the Myths
Myth 1: XMPP is complex
• XMPP is Async, and you have to think Async to keep your sanity
• Frameworks that hide the Async nature of XMPP are doing more harm than good
• XMPP has lots of specs but they are very well written (thx to our personal Saint)
• The basics are really pretty simple
Myth 2: XML is too verbose
• Yes it is. So what?
• Compression helps a lot
• But you don’t have to use XML
• Really!
XMPP without XML?(the speaker is on drugs...)
Can we build it?
• The protocol for C2S components is not standard
• Each server implements his own (OpenFire has the best specs, DJabberd is hackable, Jabberd2 and ejabberd have the possibility)
• Mobile clients are taking this route
Myth 3: XMPP is replacing the Web
Myth 3: XMPP is replacing the Web
Who ever tells you this, has a better dealer than mine...
Myth 3: XMPP is replacing the Web
• No, its not
• XMPP is a nice complement to your web applications
• Gives you a real-time feedback channel
• something happened to your data
• something happened to your friends data
Enough myths, onto Ideas
Enhance your bots
• With C2S, you have one <presence> to rule them all (*)
• With components you can have a <presence> per buddy
• adjust the bot status to something meaningful
• change the Avatar image
• Accept/initiate file transfers
Add PubSub nodes
• You can have all the user events available on the XMPP network using PubSub
• Payload is a classical Atom item
• OAuth-based access has working draft
• This is actually an economic/political problem, not technical
Add AdHoc commands
• Discoverable actions you can perform on a JID
• You GET a form, and then SET the data
• Also available standard search protocol
• Support is still immature on clients
Use virtual chat-rooms
• Chat-rooms provide many-to-many chat
• Each HTTP resource can have a associated chat-room
• Click to chat just join people looking at the same page into the same chat-room
• You can even do it in the page (Sameplace.cc)
Negative Priority
• Here be dragons...
• If IM is the known planets, negative priority is all the space in between
• Personal agents: connect with your own personal JID, and perform/accept actions on your behalf
Negative Priority
• Calendar: XMPP bot built-in: negotiate/accept/reject meeting requests
• File Server: runs on each PC you own, and allow you to browse, fetch, upload files
• Browser: share tabs between two running instances - synchronized browsing
Usual suspects
• Control a cluster: Vertebra
• Monitor stuff: embed a bot on all your scripts/long-running processes
• Your own personal secretary: remind me to pick up the kids
Think of a Real-Time feedback channel in
your own app...
... one that knows when the users are online
That’s all, folks!