Chapter 4. Exploring the XMPP Protocol: A Debugging Console


  • Hooking into Strophe's logging facilities

  • Parsing XML

  • Manipulating your presence

  • Querying for software versions

  • Dealing with XMPP errors

Developers have always enjoyed crafting and refining their tools. In your journey through XMPP applications, you will need a tool to aid exploration and to inspect protocol traffic. Few web developers could live without the view source command or the ability to easily craft URLs to test functionality of remote sites. In the world of XMPP stanzas, such a tool would allow you to inspect protocol traffic and easily create stanzas to send. You'll build a protocol debugging console named Peek over the course of this chapter, and, afterwards, you will use it to investigate a few XMPP services and typical protocol situations.

Peek will be useful throughout this book. Whenever you encounter an example stanza, you can load Peek, type in the stanza, and watch what happens in response. In this way, you can play with various XMPP features even before you start building applications.

Many of the parts required to build Peek have already been introduced: establishing connections, sending stanzas, and setting up basic handlers for incoming traffic. However, Peek will need some new features of Strophe, and once Peek is built, you'll use it to explore a few new XMPP concepts.


The finished application — shown in Figure 4-1 — is reminiscent of color terminals and code editors ...

Get Professional XMPP Programming with JavaScript® and jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.