Recently looked at the framework for XMPP, as an example of text chat, the message that needs to be sent is:
<message type= "Chat" from= "[email protected]" to= "[email protected]" >
<body>helloWord</body>
</message>
Kizhong from is the message from which user, to is sent to who, the user of XMPP is in the form of a mailbox. Body is the text of the message we send.
Well, in this case, we will develop an XMPP-based iOS chat client program, first we need XMPP server, here, I take this machine to do server, first download ejabberd this server from XMPP server, Ejabberd support Linux/mac Os x/solaris/windows, so any operating system can do our chat server. OK, after downloading, step by step installation is OK, here we have to pay attention to
Here our server is dpc1338a (generally is the machine name, the default is OK, do not need to change), each machine's user name is different, here the server domain is the machine name, this we need to remember OH
Next step, but also to set the administrator password, password of course also need to remember, otherwise we can not log on to the Administrator page.
OK, after the installation is started, the following is displayed:
When we click Admin Interface, we will be asked to enter your username and password:
Here the user name is the front of our installation when there is an administrator name, the administrator name and our server combination can be, I here is [email protected], each machine is not the same, do not copy oh, so you are unable to login, password is installed when the password set
After successful login, the following page will be displayed:
Here we need to explain is the < access control List, here is the Setup administrator, we can create other administrators here, this is not our focus, our focus is < virtual host >
Open < virtual hosting; there is a <dpc1338a>
There is a < user, and we need to create several users to interact with the data.
I created [email protected],[email protected], [email protected] These users, we will chat with these users in a few hours
OK, after the server has been installed, we need to download a client to chat, here are some client tools
http://xmpp.org/xmpp-software/clients/, here we mainly recommend Mac with Adium,windows with Citron, the next chapter we want to introduce the XMPP framework of iOS.
XMPP-based iOS chat client program (XMPP server architecture)