Before you start
This tutorial introduces you to the real-time web and takes you through some of the reasons for building real-time web applications. You'll learn techniques that allow you to create responsive, continually updated web applications that conserve server resources while providing a slick user experience.
Real-time web applications allow users to receive notifications as soon as information is published, without needing to check the original source manually for updates. They have been popularized by social-notification tools like Twitter and Friendfeed, web-based collaboration tools like Google Wave, and web-based chat clients like Meebo.
The Extensible Messaging and Presence Protocol (XMPP) is an XML-based set of technologies for real-time applications, defined as networked applications that continually update in response to new or changed data. It was originally developed as a framework to support instant messaging and presence applications within enterprise environments.
In this tutorial you will build Pingstream, a simple tool that continually updates itself with RSS feed updates as they are published (see Download for the Pingstream source code). Along the way you will:
- Learn why XMPP is particularly suited to web applications
- Learn about the components of XMPP communication
- Install and configure the Openfire XMPP server
- Connect to the XMPP server using PHP and the XMPPHP library
- Check for new items in an RSS feed and transmit them over XMPP
- Use Strophe and jQuery to connect to an XMPP server over HTTP using Bidirectional-streams Over Synchronous HTTP (BOSH)
- Display XMPP notifications in a web page
To follow along with this tutorial, you must have the following server software installed and running:
- PHP 5.2 or higher
- Apache HTTP Server
As you progress through the tutorial, you will also download and install the following software and libraries:
- Last RSS
You might also find the MySQL server tool phpMyAdmin useful. If you are using a desktop machine to test your real-time web application software locally, you might find XAMPP useful for managing the installation and running of a test web server infrastructure.
See Resources for links to all the tool downloads.