xmpp(支持UTF-8)
上一篇 / 下一篇 2010-11-11 21:14:31 / 个人分类:协议
RFC3920.cn
http://xmpp.org/rfcs/rfc3920.html
http://xmpp.org/extensions/xep-0070.html
NOTE:步骤 1: 客户端初始化流给服务器:
000000030.30461928[500] SENT (21 bytes): <?xml version="1.0"?>
000000040.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: 服务器向客户端发送流标签作为应答:
000000050.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: 服务器通知客户端可用的验证机制:
000000060.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: 客户端选择一个验证机制:
000000070.45910081[500] SENT (71 bytes): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/>
NOTE:步骤 5: 服务器发送一个 \[BASE64\] 编码的挑战给客户端:
000000080.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\]编码的回应这个挑战:
000000090.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: 服务器通知客户端验证成功:
000000100.61191577[500] RECV (116 bytes): <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD1iNTIzMjYyZDA0ZjlhOGQzNWEyMmVkYTBjODllZWRmNw==</success>
NOTE:步骤 10: 客户端发起一个新的流给服务器:
000000110.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元素):
000000120.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>
000000130.61642641[500] SENT (86 bytes): <compress xmlns="http://jabber.org/protocol/compress"><method>zlib</method></compress>
000000140.65099669[500] RECV (57 bytes): <compressed xmlns='http://jabber.org/protocol/compress'/>
000000150.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">
000000160.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>
000000170.66659909[500] SENT (71 bytes): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/>
000000180.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"
000000190.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"
000000200.68257976[500] RECV (116 bytes): <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD1jMzViYjM4MTBkM2I1MDA3Njc3ODFhNWM3YzRjMmMwMQ==</success>
000000210.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">
000000220.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:客户端绑定一个资源
000000230.68916351[500] SENT (112 bytes): <iq type="set" id="sd1">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>在线交流系统</resource></bind></iq>
NOTE:服务器通知客户端资源绑定成功
000000240.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>
000000250.70752007[500] SENT (100 bytes): <iq type="set" id="sd2" to="winxp-www">
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
000000260.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>
000000270.71279085[500] SENT (101 bytes): <iq type="get" id="sd3" to="winxp-www">
<query xmlns="http://jabber.org/protocol/disco#items"/></iq>
000000280.71514571[500] SENT (64 bytes): <iq type="get" id="sd4"><query xmlns="jabber:iq:roster"/></iq>
000000290.71535003[500] SENT (65 bytes): <iq type="get" id="sd5"><query xmlns="jabber:iq:privacy"/></iq>
000000300.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>
000000310.73308045[500] SENT (107 bytes): <iq type="get" id="sd6" to="search.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
000000320.73496360[500] SENT (107 bytes): <iq type="get" id="sd7" to="pubsub.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
000000330.73500723[500] SENT (106 bytes): <iq type="get" id="sd8" to="proxy.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
000000340.73605841[500] SENT (108 bytes): <iq type="get" id="sd9" to="manager.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
000000350.73978013[500] SENT (112 bytes): <iq type="get" id="sd10" to="conference.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
000000360.73995262[500] SENT (109 bytes): <iq type="get" id="sd11" to="updater.winxp-www">
<query xmlns="http://jabber.org/protocol/disco#info"/></iq>
000000370.76102084[500] RECV (93 bytes): <iq type="result" id="sd4" to="曾经123@winxp-www/在线交流系统">
<query xmlns="jabber:iq:roster"/></iq>
000000380.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>
000000390.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>
000000400.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>
000000410.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>
000000420.87957603[500] SENT (129 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>8</priority></presence>
0000004323.94870186[500] SENT (145 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>6</priority><show>dnd</show></presence>
0000004426.57085228[500] SENT (146 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>4</priority><show>away</show></presence>
0000004528.89712143[500] SENT (32 bytes): <presence type="unavailable"/>
0000004628.90606499[500] SENT (89 bytes): <iq type="set"><query xmlns="jabber:iq:privacy"><active name="invisible"/></query></iq>
0000004728.90665627[500] SENT (129 bytes): <presence><x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x><priority>8</priority></presence>
0000004828.96957779[500] RECV (118 bytes): <iq type="result" to="曾经123@winxp-www/在线交流系统">
<query xmlns="jabber:iq:privacy"><active name="invisible"/></query></iq>
0000004930.80803490[500] SENT (1 bytes):
0000005034.01837921[500] SENT (72 bytes): <iq type="set"><query xmlns="jabber:iq:privacy"><active/></query></iq>
0000005134.02230835[500] RECV (47 bytes): <iq type="result" to="曾经123@winxp-www/在线交流系统"/>
0000005234.02594757[500] SENT (129 bytes): <presence>
<x xmlns="jabber:x:avatar"><hash>8846ea523d1185eb903bfc2218c153a7cf3bbf70</hash></x>
<priority>8</priority>
</presence>
0000005346.84116745[500] SENT (32 bytes): <presence type="unavailable"/>
0000005446.84132004[500] SENT (16 bytes): </stream:stream>
TAG:
我的栏目
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | ||||||
5 | 6 | 7 | 8 | 9 | 10 | 11 | |||
12 | 13 | 14 | 15 | 16 | 17 | 18 | |||
19 | 20 | 21 | 22 | 23 | 24 | 25 | |||
26 | 27 | 28 | 29 | 30 | 31 |
数据统计
- 访问量: 86160
- 日志数: 218
- 书签数: 1
- 建立时间: 2010-11-06
- 更新时间: 2011-03-21