简体   繁体   中英

node.js, XMPP Strophe.js

I am currently thinking of adding a realtime notification system to my site and so far my choices are using node.js or an XMPP server with a js XMPP librairy such as strophe.js. Right now i will just need it for a realtime notification systems on my site, but it will likely evole in more complexe features such as a chat system.

So i have the following questions:

  1. How do these 2 technologies differs ?

  2. Which of these 2 technologies would be "more suitable" to integrate in a site running on a LAMP environement.

Thanks,

XMPP is a protocol. The most common server implementations are ejabberd (Erlang) & Openfire (Java). Web clients connect over BOSH (long polling).

Node.js is simply an environment for javascript execution. Something like socket.io, is really more of a transport abstraction layer. It's up to you to design & implement your communication protocol.

If you want to use xmpp then you have 3 choices for the server technology to use:

Jabber2 (C++)
eJabberd (Erlang)
Openfire (Java)
Prosody IM (Lua)

so if you want to develop some unique server-side functionality you should have some skills in C++, erlang, java or lua. I use openfire because I'm familiar with java. Openfire also provide good plugin system. But if you just want to have some chat on your website then you can just setup one of these XMPP servers on your server-computer and the only thing you need after that is to code some browser-side functionality using strophe.js (which is pretty simple).

If you don't want to go with c++, ejabberd, java, lua and you still need some server-side functionality use node.js.

Both xmpp and node.js chat applications can be integrated with LAMP websites pretty easily (you only need to modify your website javascript, no php code needed), but if you prefer LAMP technology I bet node.js is the right thing for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM