xmpp协议分析

蹲街弑〆低调 提交于 2019-12-19 21:13:27

 

连接服务器:

 

SENT: <stream:stream to="jabber.cn" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" >
RECV: <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' id='43FEAEE5' xmlns='jabber:client' from='jabber.cn' version='1.0'>
RECV: <stream:features><register xmlns='http://jabber.org/features/iq-register'/><auth xmlns='http://jabber.org/features/iq-auth'/></stream:features>

 

登录(身份验证):

 

SENT: <iq id="jcl_103" type="get"><query xmlns="jabber:iq:auth"><username>renziyi</username></query></iq>
RECV: <iq id='jcl_103' type='result'><query xmlns='jabber:iq:auth'><username>renziyi</username><digest/><password/><resource/></query></iq>
SENT: <iq id="jcl_104" type="set"><query xmlns="jabber:iq:auth"><username>renziyi</username><resource>Exodus</resource><digest>2ee43612345655d3279a45227ede2969c7</digest></query></iq>
RECV: <iq id='jcl_104' type='result'/>

 

下载好友名单:

 

SENT: <iq id="jcl_105" type="get"><query xmlns="jabber:iq:roster"/></iq>

RECV: <iq id='jcl_105' type='result' from='renziyi@jabber.cn/Exodus'><query xmlns='jabber:iq:roster'><item jid='renzy@jabber.cn' name='renzy' subscription='to'><group>Friends</group></item></query></iq>

 

更改自己状态为上线:
SENT: <presence><c node="http://exodus.jabberstudio.org/caps" ver="0.9.1.0" xmlns="http://jabber.org/protocol/caps"/><status>Available</status><priority>1</priority></presence>

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!