What are XMPP extensions (XEPs), and how do I use them?
Asked Answered
S

2

5

I am trying to make a chat application using Openfire and Strophe.js.

I always read about XEPs, etc. and it is always redirecting me to XMPP Extensions and I don't even know how to use these extensions. This may seems like a dumb question but I can accept that since I am new to XMPP - but how do we use the extensions?

Suffragist answered 10/8, 2013 at 16:41 Comment(0)
D
12

Anybody asking this question should generally be starting with an XMPP library that implements everything they need already.

It still deserves an answer though!

XMPP stands for eXstensible Messaging and Presence Protocol. The 'extensible' part is important. XMPP is based around XML, a data format that supports a concept known as namespacing.

Through namespacing, you can add bits to XMPP that are not defined in the original specifications. This is important because the XMPP specification deliberately describes only a set of core things like:

  • How a client connects to a server
  • Encryption (SSL/TLS)
  • Authentication
  • How servers can communicate with each other to relay messages

...and a few other basic building blocks.

Once you have implemented this stuff, you have an XMPP client and can send any kind of data you like! But that's also a problem.

For example, perhaps you decide that you want to include formatting in a message (bold, italic, etc.) which is not defined in the core XMPP specification. Well, you can make up a way to do that, but unless everyone else does it the same way as you, no other software will be able interpret it (they will just ignore namespaces they don't understand).

So the XMPP Standards Foundation (XSF) publishes a series of extra documents, known as XMPP Enhancement Proposals (XEPs). In general each XEP describes a particular activity (from message formatting, to file transfers, multi-user chats and many more), and they provide a standard format for everyone to use for that activity.

You mentioned Strophe.js. This is a "low-level" library which expects you to implement the extensions that you need yourself. I don't consider most of them hard, but you would have to spend some time learning if you are unfamiliar with bidirectional protocols, basic XML/DOM concepts, and so on. The Strophe.js author wrote a good book which can also serve as an introduction to XMPP web development, Professional XMPP Programming with Javascript and jQuery.

This question is also answered in some detail in XMPP: The Definitive Guide, which also provides an extensive overview of the core protocol and common extensions.

For further online reading of XMPP, this StackOverflow question may give some pointers: "Good tutorials on XMPP?".

Hope this helps!

Dews answered 11/8, 2013 at 15:35 Comment(0)
D
1

In addition to MattJ's XEP description:

If you are using Strophe and you need to use functionality specified in an XEP, take a look at the Strophe Plugin repository to see if it has been implemented for you already.

As an example, the XEP-0045: Multi-User Chat extension is implemented in the Strophe MUC plugin within that repository.

Doeskin answered 15/11, 2013 at 21:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.