Jabber Troubleshooting

From DreamHost
Jump to: navigation, search

Yes, you can use simple telnet to test out the functionality of a XMPP server. In a pinch, you can even use telnet to engage in a full IM conversation (though it gets painful after a while!). To connect, type 'telnet localhost 5222'. Of course, make sure to replace 'localhost' with the hostname of your server. Then cut and paste the following XML snippets into your telnet window and watch the XML fly by!

STEP 1: open an XML Stream to the server:

 <stream:stream 
   to='localhost' 
   xmlns='jabber:client' 
   xmlns:stream='http://etherx.jabber.org/streams'>

STEP 2: receive a response from the server.

STEP 3: find out how to register an account:

 <iq id='A0' type='get'>
   <query xmlns='jabber:iq:register'/>
 </iq>

STEP 4: receive a response from the server.

STEP 5: register an account:

 <iq id='A1' type='set'>
   <query xmlns='jabber:iq:register'>
     <username>jabberuser</username>
     <password>testing</password>
     <name>myName</name>
     <email>email@domain.com</email>
   </query>
 </iq>

STEP 6: receive a response from the server.

STEP 7: find out how to authenticate:

 <iq id='A2' type='get'>
   <query xmlns='jabber:iq:auth'>
     <username>jabberuser</username>
   </query>
 </iq>

STEP 8: receive a response from the server.

STEP 9: authenticate (log in):

 <iq id='A3' type='set'>
   <query xmlns='jabber:iq:auth'>
     <username>jabberuser</username>
     <resource>telnet</resource>
     <password>testing</password>
   </query>
 </iq>

STEP 10: receive a response from the server.

STEP 11: send presence to the server:

 <presence/>

STEP 12: now you can send messages or whatever you'd like to do!

 <message to='contact@localhost'>
   <body>hello!</body>
 </message>