How easy is it to get a custom XMPP server-app running?
With reference to this question, XMPP was mentioned as the open standard for IM interoperability.
For my app the big choice there would be if I use XMPP for internal client-server communication, or develop my own internal protocol but use XMPP on the server to allow communication with other servers, at a later date. My gut feeling is the latter would be easier, but maybe I'm overestimating how much work it would be to take an existing Jabber server or XMPP server libs and build a custom server app?
If my client will always talk to my server, never directly to other servers, is using XMPP sensible or overkill?
Say I want to have my own DB for users, messages, groups, and custom data. What's actually involved getting开发者_StackOverflow中文版 this set up using XMPP so that I can freely send data to my server, and have my custom server logic handle it? Do any of the libraries out there allow me to run a 'skeleton' XMPP server where I provide my own handlers which are called when messages are received, etc?
I get the overall idea of XMPP but am a bit lost where I'd actually start with it, even to the extent of differentiating between whether I'd need a Jabber server app or one of the open-source server libraries around.
There's also the licensing issue. I certainly don't plan to open-source the main code-base and if I were to use a GPL XMPP solution for client-server communication, my understanding is I'd struggle not to 'taint' my code with GPL.
Quite easy if you are under linux
sudo apt-get install ejabberd
then you can point your preferred IM client to localhost:5222 and you are done. For sure if you want a domain name, etc. more configuration/installation stuff will needed, but I think this is not what are you asking for.
Note: There is also a windows version for ejabberd, http://www.process-one.net/en/ejabberd/downloads
If you really want XMPP, Openfire would be one of the easiest to setup http://www.igniterealtime.org/projects/openfire/, I'd also look at BlazeDS if you work with Java for example.
You could write an XMPP server component. This will work with any XMPP server that implements XEP 0114. All major XMPP server implementations do that.
If you have an XMPP server component on component.localhost.localdomain
and your server runs on localhost.localdomain
, then any message that the server receives that is addressed to any user on component.localhost.localdomain
will immediately be passed to the server component. There you can do with it whatever you want (e.g. processing, storing in a database, etc). Replies are sent to the original sender through the XMPP server again, so the component does not have to deal with server tasks.
The Ruby libraries xmpp4r and blather both make it very easy to write a server component in Ruby.
The big advantage of XMPP server components over server plugins is that they are independent of the server's code as they communicate over a standardised interface (as defined in XEP 0114). The disadvantage is that a component doesn't have access to server internal data structures, which may or may not be a problem dependent on your application.
If, however, you never really want to have your application communicate with other servers, using XMPP doesn't really make a lot of sense.
精彩评论