http://xmpp.org/rfcs/rfc3920.html
http://xmpp.org/extensions/xep-0070.html
NOTE:步骤 1: 客户端初始化流给服务器:
00000003 0.30461928 [500] SENT (21 bytes): <?xml version="1.0"?>
00000004 0.30817932 [500] SENT (131 bytes): <stream:stream to="winxp-www" xml:lang="zh-cn" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
NOTE:步骤 2: 服务器向客户端发送流标签作为应答:
00000005 0.39031130 [500] RECV (185 bytes): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="winxp-www" id="120f62d9" xml:lang="zh-cn" version="1.0">
NOTE:步骤 3: 服务器通知客户端可用的验证机制:
00000006 0.45563573 [500] RECV (425 bytes): <stream:features>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
<mechanism>ANONYMOUS</mechanism>
<mechanism>CRAM-MD5</mechanism>
</mechanisms>
<compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
<auth xmlns="http://jabber.org/features/iq-auth"/>
<register xmlns="http://jabber.org/features/iq-register"/>
</stream:features>
NOTE:步骤 4: 客户端选择一个验证机制:
00000007 0.45910081 [500] SENT (71 bytes): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/>
NOTE:步骤 5: 服务器发送一个 \[BASE64\] 编码的挑战给客户端:
00000008 0.53900111 [500] RECV (212 bytes): <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09IndpbnhwLXd3dyIsbm9uY2U9IkVPSWNLYis4Tm41dmkvek1xTE91T1htTzAxVGdiSWFWalN2RUllMGwiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
解码"realm="winxp-www",nonce="EOIcKb+8Nn5vi/zMqLOuOXmO01TgbIaVjSvEIe0l",qop="auth",charset=utf-8,algorithm=md5-sess"
NOTE:步骤 6: 客户端发送一个\[BASE64\]编码的回应这个挑战:
00000009 0.54505259 [500] SENT (388 bytes): <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Iuabvue7jzEyMyIscmVhbG09IndpbnhwLXd3dyIsbm9uY2U9IkVPSWNLYis4Tm41dmkvek1xTE91T1htTzAxVGdiSWFWalN2RUllMGwiLGNub25jZT0iMzhiNzM1YzRhOGU4YTFlNzgxM2E2ZWU1ZDRjMzgwY2I1Y2RmMDQxMyIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC93aW54cC13d3ciLGNoYXJzZXQ9dXRmLTgscmVzcG9uc2U9MzA3YjkxODhjYjU2YzYwNGU4NTc0ZmNlNzE1MDAyYzk=</response>
解码"username="曾经123",realm="winxp-www",nonce="EOIcKb+8Nn5vi/zMqLOuOXmO01TgbIaVjSvEIe0l",cnonce="38b735c4a8e8a1e7813a6ee5d4c380cb5cdf0413",nc=00000001,qop=auth,digest-uri="xmpp/winxp-www",charset=utf-8,response=307b9188cb56c604e8574fce715002c9"
NOTE:步骤 9: 服务器通知客户端验证成功:
00000010 0.61191577 [500] RECV (116 bytes): <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD1iNTIzMjYyZDA0ZjlhOGQzNWEyMmVkYTBjODllZWRmNw==</success>
NOTE:步骤 10: 客户端发起一个新的流给服务器:
00000011 0.61294025 [500] SENT (131 bytes): <stream:stream to="winxp-www" xml:lang="zh-cn" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
NOTE:步骤 11: 服务器发送一个流头信息回应客户端,并附上任何可用的特性(或空的features元素):
00000012 0.61496103 [500] RECV (414 bytes): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="winxp-www" id="120f62d9" xml:lang="zh-cn" version="1.0">
<stream:features>
<compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
NOTE:服务器需要客户端绑定一个资源
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</stream:features>
00000013 0.61642641 [500] SENT (86 bytes): <compress xmlns="http://jabber.org/protocol/compress"><method>zlib</method></compress>
00000014 0.65099669 [500] RECV (57 bytes): <compressed xmlns='http://jabber.org/protocol/compress'/>
00000015 0.66114199 [500] SENT (131 bytes): <stream:stream to="winxp-www" xml:lang="zh-cn" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
00000016 0.66510236 [500] RECV (512 bytes): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="winxp-www" id="120f62d9" xml:lang="zh-cn" version="1.0">
<stream:features>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
<mechanism>ANONYMOUS</mechanism>
<mechanism>CRAM-MD5</mechanism>
</mechanisms>
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</stream:features>
00000017 0.66659909 [500] SENT (71 bytes): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/>
00000018 0.66999900 [500] RECV (212 bytes): <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09IndpbnhwLXd3dyIsbm9uY2U9InFtcWpQbGhCWE90eTBhR0NmakJvNHJHWlNHVFB1Q1gvYnVWUEppU3giLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
解码"realm="winxp-www",nonce="qmqjPlhBXOty0aGCfjBo4rGZSGTPuCX/buVPJiSx",qop="auth",charset=utf-8,algorithm=md5-sess"
00000019 0.67361242 [500] SENT (388 bytes): <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Iuabvue7jzEyMyIscmVhbG09IndpbnhwLXd3dyIsbm9uY2U9InFtcWpQbGhCWE90eTBhR0NmakJvNHJHWlNHVFB1Q1gvYnVWUEppU3giLGNub25jZT0iZTBiNmZiNTBiYTMzNTBjNDk3MjJmMjJhYzE2ODcwNjAzZWExZDY3NSIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC93aW54cC13d3ciLGNoYXJzZXQ9dXRmLTgscmVzcG9uc2U9NWM5MTEzNDdjYzJiNjMzZWMwMjgzZGY3M2QzOTgxMWU=</response>
解码"username="曾经123",realm="winxp-www",nonce="qmqjPlhBXOty0aGCfjBo4rGZSGTPuCX/buVPJiSx",cnonce="e0b6fb50ba3350c49722f22ac16870603ea1d675",nc=00000001,qop=auth,digest-uri="xmpp/winxp-www",charset=utf-8,response=5c911347cc2b633ec0283df73d39811e"
00000020 0.68257976 [500] RECV (116 bytes): <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD1jMzViYjM4MTBkM2I1MDA3Njc3ODFhNWM3YzRjMmMwMQ==</success>
00000021 0.68359655 [500] SENT (131 bytes): <stream:stream to="winxp-www" xml:lang="zh-cn" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
00000022 0.68648988 [500] RECV (322 bytes): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="winxp-www" id="120f62d9" xml:lang="zh-cn" version="1.0">
<stream:features>
NOTE:服务器需要客户端绑定一个资源
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</stream:features>
NOTE:客户端绑定一个资源
00000023 0.68916351 [500] SENT (112 bytes): <iq type="set" id="sd1">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>在线交流系统</resource></bind></iq>
NOTE:服务器通知客户端资源绑定成功
00000024 0.70382249 [500] RECV (143 bytes): <iq type="result" id="sd1" to="winxp-www/120f62d9">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
<jid>曾经123@winxp-www/在线交流系统</jid>
</bind></iq>
00000025 0.70752007 [500] SENT (100 bytes): <iq type="set" id="sd2" to="winxp-www">
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
00000026 0.71029431 [500] RECV (131 bytes): <iq type="result" id="sd2" from="winxp-www" to="曾经123@winxp-www/在线交流系统">
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
00000027 0.71279085 [500] SENT (101 bytes): <iq type="get" id="sd3" to="winxp-www">
<query xmlns="http://jabber.org/protocol/disco#items"/></iq>
00000028 0.71514571 [500] SENT (64 bytes): <iq type="get" id="sd4"><query xmlns="jabber:iq:roster"/></iq>
00000029 0.71535003 [500] SENT (65 bytes): <iq type="get" id="sd5"><query xmlns="jabber:iq:privacy"/></iq>
00000030 0.72743601 [500] RECV (484 bytes): <iq type="result" id="sd3" from="winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#items">
<item jid="search.winxp-www" name="User Search"/>
<item jid="pubsub.winxp-www" name="Publish-Subscribe service"/>
<item jid="proxy.winxp-www" name="Socks 5 Bytestreams Proxy"/>
<item jid="manager.winxp-www" name="Client Control Manager"/>
<item jid="conference.winxp-www" name="Public Chatrooms"/>
<item jid="updater.winxp-www" name="Spark Updater"/></query></iq>
00000031 0.73308045 [500] SENT (107 bytes): <iq type="get" id="sd6" to="search.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
00000032 0.73496360 [500] SENT (107 bytes): <iq type="get" id="sd7" to="pubsub.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
00000033 0.73500723 [500] SENT (106 bytes): <iq type="get" id="sd8" to="proxy.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
00000034 0.73605841 [500] SENT (108 bytes): <iq type="get" id="sd9" to="manager.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
00000035 0.73978013 [500] SENT (112 bytes): <iq type="get" id="sd10" to="conference.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
00000036 0.73995262 [500] SENT (109 bytes): <iq type="get" id="sd11" to="updater.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
00000037 0.76102084 [500] RECV (93 bytes): <iq type="result" id="sd4" to="曾经123@winxp-www/在线交流系统">
<query xmlns="jabber:iq:roster"/></iq>
00000038 0.77130777 [500] RECV (467 bytes): <iq type="result" id="sd5" to="曾经123@winxp-www/在线交流系统">
<query xmlns="jabber:iq:privacy">
<list name="invisible"/></query></iq>
<iq type="result" id="sd6" from="search.winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="directory" type="user" name="User Search"/>
<feature var="jabber:iq:search"/>
<feature var="http://jabber.org/protocol/disco#info"/>
<feature var="http://jabber.org/protocol/rsm"/>
</query></iq>
00000039 0.79031312 [500] RECV (2049 bytes): <iq type="result" id="sd7" from="pubsub.winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="pubsub" name="Publish-Subscribe service" type="service"/>
<feature var="http://jabber.org/protocol/pubsub"/>
<feature var="http://jabber.org/protocol/pubsub#collections"/><feature var="http://jabber.org/protocol/pubsub#config-node"/>
<feature var="http://jabber.org/protocol/pubsub#create-and-configure"/>
<feature var="http://jabber.org/protocol/pubsub#create-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#delete-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#get-pending"/>
<feature var="http://jabber.org/protocol/pubsub#instant-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#item-ids"/>
<feature var="http://jabber.org/protocol/pubsub#meta-data"/>
<feature var="http://jabber.org/protocol/pubsub#modify-affiliations"/>
<feature var="http://jabber.org/protocol/pubsub#manage-subscriptions"/>
<feature var="http://jabber.org/protocol/pubsub#multi-subscribe"/>
<feature var="http://jabber.org/protocol/pubsub#outcast-affiliation"/>
<feature var="http://jabber.org/protocol/pubsub#persistent-items"/>
<feature var="http://jabber.org/protocol/pubsub#presence-notifications"/>
<feature var="http://jabber.org/protocol/pubsub#publish"/>
<feature var="http://jabber.org/protocol/pubsub#publisher-affiliation"/>
<feature var="http://jabber.org/protocol/pubsub#purge-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#retract-items"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-affiliations"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-default"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-items"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-subscriptions"/>
<feature var="http://jabber.org/protocol/pubsub#subscribe"/>
<feature var="http://jabber.org/protocol/pubsub#subscription-options"/>
<feature var="http://jabber.org/protocol/pubsub#default_access_model_open"/>
<feature var="http://jabber.org/protocol/disco#info"/>
</query></iq>
00000040 0.79072374 [500] RECV (650 bytes): <iq type="result" id="sd8" from="proxy.winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="proxy" name="SOCKS5 Bytestreams Service" type="bytestreams"/>
<feature var="http://jabber.org/protocol/bytestreams"/>
<feature var="http://jabber.org/protocol/disco#info"/></query>
</iq><iq type="result" id="sd9" from="manager.winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="manager" type="text" name="Client Control Manager"/>
<feature var="broadcast"/><feature var="file-transfer"/>
<feature var="muc"/><feature var="vcard"/></query></iq>
00000041 0.79181653 [500] RECV (777 bytes): <iq type="result" id="sd10" from="conference.winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="conference" name="Public Chatrooms" type="text"/>
<identity category="directory" name="Public Chatroom Search" type="chatroom"/>
<feature var="http://jabber.org/protocol/muc"/>
<feature var="http://jabber.org/protocol/disco#info"/>
<feature var="http://jabber.org/protocol/disco#items"/>
<feature var="jabber:iq:search"/>
<feature var="http://jabber.org/protocol/rsm"/>
</query></iq>
<iq type="result" id="sd11" from="updater.winxp-www" to="曾经123@winxp-www/在线交流系统">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="updater" type="text" name="Spark Updater"/>
<feature var="jabber:iq:updater"/></query></iq>
00000042 0.87957603 [500] SENT (129 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>8</priority></presence>
00000043 23.94870186 [500] SENT (145 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>6</priority><show>dnd</show></presence>
00000044 26.57085228 [500] SENT (146 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>4</priority><show>away</show></presence>
00000045 28.89712143 [500] SENT (32 bytes): <presence type="unavailable"/>
00000046 28.90606499 [500] SENT (89 bytes): <iq type="set"><query xmlns="jabber:iq:privacy"><active name="invisible"/></query></iq>
00000047 28.90665627 [500] SENT (129 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>8</priority></presence>
00000048 28.96957779 [500] RECV (118 bytes): <iq type="result" to="曾经123@winxp-www/在线交流系统">
<query xmlns="jabber:iq:privacy"><active name="invisible"/></query></iq>
00000049 30.80803490 [500] SENT (1 bytes):
00000050 34.01837921 [500] SENT (72 bytes): <iq type="set"><query xmlns="jabber:iq:privacy"><active/></query></iq>
00000051 34.02230835 [500] RECV (47 bytes): <iq type="result" to="曾经123@winxp-www/在线交流系统"/>
00000052 34.02594757 [500] SENT (129 bytes): <presence>
<x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x>
<priority>8</priority>
</presence>
00000053 46.84116745 [500] SENT (32 bytes): <presence type="unavailable"/>
00000054 46.84132004 [500] SENT (16 bytes): </stream:stream>