Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My complete requirement is development of a chat engine - including server, clients etc. Currently I am working on things at my desktop only but once done, I have to host it; basically incorporate it with in a site for chatting purpose. So, now my problem is:

I am not clear about how the actual data flow is? I have googled and read about xmpp (a book by Peter Andre) also but I am not clear about the flow and what are the actual requirements to do the above mentioned task. What I currently know is:

  1. I need a server - so selected ejabberd

  2. I need client - still not sure which one to use and one other doubt is how this client thing will work when deployed on some website for chatting purpose.

  3. Some library - don't know which one and what is the purpose?

Can anyone guide me?

share|improve this question

3 Answers 3

This concerns points 2 and 3:

You can communicate through Protocol Buffers or MessagePack. They can be used with a variety of languages as they have bindings for many languages. Data can be transferred in a platform/device independent manner through them.

Now-a-days, chat clients can be pure javascript based, so that they can interact asynchronously with the chat server (or maybe in an event driven manner).

share|improve this answer

Your server should be an XMPP server, and indeed ejabberd is an option. One which we use here as well.

Secondly you say you need a client but at 3 you ask which library you need, so the question is if you need to write a client yourself or use an external client.

In the case of an external client you only need to configure the server and then connect the client to it. (Pidgin is a client in which you can connect to a XMPP server)

If you need a library it is probably to write the client itself. For this you have many options. One for Javascript is Strophe. For PHP you have XMPPHP.

Since you need to "write" a chat I'm guessing you have to write the client yourself. So you need to do the following: Set the domain and server. Then make sure the client can log in with his data. Set a connection to a set client. If this is a 'room' you can make the room a client that receives messages from all the others and then send a message to all other users saying: 'user:message'.

I hope this gives you a clear answer?

share|improve this answer

We have used the Openfire xmpp server to build a custom solution, for in-house chat, in java.

The server is very stable. Actually we have restarted the server only once and it is working 9 months now. The Openfire website provides all additional libraries like "smack" to build your own client.

You will find also a ready to use IM client named "Spark".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.