I'm about to develop a website that has near real time chat. I know that it can be implemented using xmpp or websocket protocols. I know also that the xmpp protocol has been developed in 1999 , and I guess it should be mature nowadays .On the other hand , the websocket protocol has been developed in 2011.
If you need to open multiple connections per user, WebSocket is the one for you. If you have major concerns about security, then XMPP is the protocol for you. If you require built-in presence and messaging functionality, XMPP is your best choice.
RFC 3920 XMPP is an open Instant Messaging chat protocol, one we used at Easy web conferencing and screen sharing. So it simply does not have much use in any website that does not need to implement its own chat function. XMPP may be on the decline, due to the newer WebRTC, which includes video elements as well as text.
XMPP protocol supports the transmission of current information such as data. As a messaging protocol, it can only be applied effectively by moving through an appropriate transport binding such as TCP/IP, HTTP, or WebSocket. Some of the XMPP applications include Gtalk and Whatsapp.
Drawbacks or disadvantages of XMPP protocol ➨It does not have QoS mechanism as used by MQTT protocol. ➨Streaming XML has overhead due to text based communication compare to binary based communication. ➨XML content transports asynchronously. ➨Server may overload with presence and instant messaging.
The short answer is 'both'.
XMPP is a set of application protocol for doing real-time chat (and many other things, for that matter) - it then has to be transported across the network somehow, so you need a transport binding. There are three main transport bindings for XMPP -
So if you're developing a chat application in a browser, you'd choose XMPP as the application protocol and you'd use websockets (in a modern browser) or BOSH (in an older browser) as the network transport. If you use an XMPP library for Javascript like Stanza.io (https://github.com/otalk/stanza.io), it'll support both and you'll just be thinking about 'XMPP' rather than the transport layer, other than at setup when you have to tell it what endpoint to connect to.
(You can't use 'just websockets' for chat - you can use websockets without XMPP, but what this really means is that you're inventing your own application-layer protocol for chat, and the odds are you're going to save a lot of time and headaches by taking advantage of the work that's already gone into writing one with useful properties (security, identity, extensibility etc.) and for which there are existing libraries and servers by going XMPP instead.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With