Search code examples
mobilesocket.ioxmppchatlibwebsockets

Web Socket or XMPP ? Which is better for mobile application for making chat applications


I want to create a chat application. My chat application is properly working as a real time chat at web server using continuous polling and pushing data. But, Polling is not a good solution for mobile application. Since, Our whole chat is already built as HTTP Rest API so, moving to XMPP is a great deal for us.

So,We just came to know about WebSocket. Can anyone suggest me which is better for real time chat in this situation. WebSocket is very fast and we didn't need continuous timer polling from server also.

Do suggest better option if any and thanks :)


Solution

  • One creation purpose of XMPP was instant messaging. It had a server on jabber.com, and also having possibility of setting up a server on your own due to its open source nature. But, XMPP is an XML based application protocol which will not allow you to do some specific customizations. Also possibly you will want to use websockets as transport protocol (except handshakes) for your XMPP for real-time messaging.

    Since Websocket will make you to write your own app with some effort, you will get strength to design it as you wish.

    You can use path decleration of websockets to declare different channels and broadcast incoming data to all connected users. Its up to you.