I have read a lot of questions relating this, but none of them are satisfying.
Existing App
A minimalist social network implemented using Expressjs as an API.Using MySql as DB.socket.io for notifications and ember.js as a frontend framework.
What I want to integrate
I want to implements only a few features of XMPP such as
- Peer 2 Peer Messaging
- Presence and Last Seen
- Group Chat
- Read Receipts
A basic idea I got from reading similar questions.
- Need a client library (Strophe.js,Converse.js)
- Need a XMPP server (ejabberd,Openfire,Prosody)
Questions
What I asked might be too broad.But still don't have any idea on using which set technologies to use.
Bruno the Jabber™ BearAndroid.
WhatsApp uses Extensible Messaging and Presence Protocol (XMPP) to exchange data between the users. The protocol is decentralized, secure, and flexible. It can be used to transfer messages both in one-on-one context and in group chats. The company uses XMPP server called ejabberd with a FreeBSD operating system.
This is an organization based application. In this app, I have to implement chat functionality. So as we all know Socket.io is the best solution for instant messaging app and its reliability.
For learning purpose you can achieve all things using ejabberd+converse.js Below steps will setup environment in ubuntu
create a host binding by editing /etc/hosts file in ubuntu
127.0.1.2 talk.rajesh6115.local
install apache2 using
sudo apt-get update
sudo apt-get install apache2
setup a virtual host for bosh (XEP-0206) in your apache like below /etc/apache2/sites-available/talk.rajesh6115.local.conf
<VirtualHost *:80>
ServerName talk.rajesh6115.local
ServerAlias www.talk.rajesh6115.local
ServerAdmin [email protected]
DocumentRoot /var/www/talk.rajesh6115.local
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass /http-bind http://talk.rajesh6115.local:5280/http-bind/
ProxyPassReverse /http-bind http://talk.rajesh6115.local:5280/http-bind/
</VirtualHost>
now you can configure converse js to point to your bosh service, then your communications starts
NOTE:
setup a virtual host in ejabberd by adding a line like below
hosts:
- "talk.rajesh6115.local"
setup a admin login. using this login you can create user.
admin:
user:
- "admin": "talk.rajesh6115.local"
7.finally how to integrate with web application?
Method1 (simple): use same logins for webapp and xmpp means [email protected] can be a email address also a valid jid
Method2: Use a authentication server which will return both jid and password after successful authentication, then start your xmpp session using provided credential.
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