XMPP Protocol - GeeksforGeeks

21 Mar, 2018
XMPP is a short form for Extensible Messaging Presence Protocol. It’s protocol for streaming XML elements over a network in order to exchange messages and presence information in close to real time. This protocol is mostly used by instant messaging applications like WhatsApp.
Let’s dive into each character of word XMPP:
X : It means eXtensible. XMPP is a open source project which can be changed or extended according to the need.
M : XMPP is designed for sending messages in real time. It has very efficient push mechanism compared to other protocols.
P : It determines whether you are online/offline/busy. It indicates the state.
P : XMPP is a protocol, that is, a set of standards that allow systems to communicate with each other.
These are the basic requirements of any Instant Messenger which are fulfilled by XMPP:
Send and receive messages with other users.Check and share presence statusManage subscriptions to and from other users.Manage contact listBlock communications(receive message, sharing presence status, etc) to specific users.
Send and receive messages with other users.
Check and share presence status
Manage subscriptions to and from other users.
Manage contact list
Block communications(receive message, sharing presence status, etc) to specific users.
Other XMPP features:
Decentralised –XMPP is based on client-server architecture, i.e. clients don’t communicate directly, they do it with the help of server as intermediary. It is decentralised means there is no centralised XMPP server just like email, anyone can run their own XMPP server.
Each XMPP client is identified by JID (Jabber ID).
#JID
 {
   user,
   server,
   resource
}

For example, I’m a whatsApp user and I’m identified by my mobile number, so
   user = "8767898790"
   server = "whatsapp.com"
   resource = "mobile"

   JID : "8767898790@whatsapp.com/mobile"

resource is used in case the application support mobile as well as desktop or web application, so it can be optional in case a Instant Messenger Application support only single kind of resource.
XMPP implementation –
The original protocol for XMPP is Transmission Control Protocol, using open ended XML streams over long lived TCP connections.
In some cases, there are restricted firewalls, XMPP(port 5222) is blocked, so it can’t be used for web applications and users behind restricted firewalls, to overcome this, XMPP community also developed a HTTP transport.And as the client uses HTTP, most firewalls allow clients to fetch and post messages without any problem. Thus, in scenarios where the TCP port used by XMPP is blocked, a server can listen on the normal HTTP port and the traffic should pass without problems.
References:xmpp.orgXMPP wiki
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
HTML and XML
Web technologies-HTML and XML
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Remove elements from a JavaScript Array
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
Difference between var, let and const keywords in JavaScript
Differences between Functional Components and Class Components in React
How to apply style to parent if it has child with CSS?
Difference Between PUT and PATCH Request
How to execute PHP code using command line ?
REST API (Introduction)
How to redirect to another page in ReactJS ?