Book Image

Practical XMPP

By : Steven Watkin, David Koelle
Book Image

Practical XMPP

By: Steven Watkin, David Koelle

Overview of this book

XMPP (eXtensible Messaging and Presence Protocol) is a messaging protocol that enables communication between two or more devices via the Internet. With this book, developers will learn about the fundamentals of XMPP, be able to work with the core functionality both server-side and in the browser, as well as starting to explore several of the protocol extensions. You will not only have a solid grasp of XMPP and how it works, but will also be able to use the protocol to build real-world applications that utilize the power of XMPP. By the end of this book, you will know more about networking applications in general, and have a good understanding of how to extend XMPP, as well as using it in sample applications.
Table of Contents (16 chapters)
Practical XMPP
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
An Introduction to XMPP and Installing Our First Server

Connection flow for components


The rather simple connection flow for a component is as follows: once a connection is established between the component and the XMPP server, the component sends the following stream opening:

<stream:stream 
    xmlns='jabber:component:accept' 
    xmlns:stream='http://etherx.jabber.org/streams' 
    to='component.mcfly.fam'> 

Note that the to address is the address that the component would like to be called with once it is attached to the server. It is not the address of the XMPP server (which would be mcfly.fam) as you might expect.

Once the server receives this stream opener and knows that it is configured for a component on this address, it responds with another stream, as follows:

<stream:stream xmlns:stream='http://etherx.jabber.org/streams' 
    xmlns='jabber:component:accept' id='88mph' 
    from='component.mcfly.fam'> 

In order to prove their identity, components make use of a simple pre-shared string. This is combined with the stream ID sent...