SlideShare a Scribd company logo
1 of 22
 
規格 ,[object Object],[object Object],[object Object],[object Object],[object Object],沢山あるけど,基本はこんな感じ
JID 各パーツは 1023B 以下 “ @ “ とか “ / “ とかも含めて 3071B 以下 IPv4address / IPv6address = address-literal ( internationalized domain label ) = sub-domain ( sub-domain 1 * ( “ . “  sub-domain ) ) = fqdn fqdn / address-literal = domain [ node “ @ ” ] domain [ “ / ” resource ] = jid
メッセージ転送 ( client / server ) ,[object Object],[object Object],[object Object],[object Object],< user @ example . com > < user @ example . com / resouce > 一致するアカウントがなければ無視,もしくはエラー ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
メッセージ転送 ( server / server ) ,[object Object],[object Object],[object Object],[object Object]
セッション TCP TLS SASL Resource Binding ( user @ domain / resource ) クライアント サーバ < session / > < message / >, < presence / > option メッセージの やりとりをする までに必要な 設定
message syntax ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IQ ( Info / Query ) syntax Requesting Entity Responding Entity < iq type = ‘ get ‘ id = ‘ 1 ‘ > < iq type = ‘ result ‘ id = ‘ 1 ‘ > < iq type = ‘ set ‘ id = ‘ 2 ‘ > < iq type = ‘ error ‘ id = ‘ 2 ‘ > type 属性は4 種類 理由がない限り必須 id 属性も理由がない限り必須
Psi2OpenFire  (設定) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Psi2OpenFire ( TLS 開設まで) -- C2S— <?xml version=&quot;1.0&quot;?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; version=&quot;1.0&quot; xmlns=&quot;jabber:client&quot; to=&quot;foo.hoge.co.jp&quot; xml:lang=&quot;en&quot; xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; > -- S2C -- <?xml version='1.0' encoding='UTF-8'?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; xmlns=&quot;jabber:client&quot; from=&quot;foo.hoge.co.jp&quot; id=&quot;b9a694d9&quot; xml:lang=&quot;en&quot; version=&quot;1.0&quot;> -- S2C -- -- TLS による通信要求  -- <stream:features> <starttls xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot;/> <mechanisms xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;> <mechanism>PLAIN</mechanism> <mechanism>CRAM-MD5</mechanism> <mechanism>ANONYMOUS</mechanism> <mechanism>DIGEST-MD5</mechanism> </mechanisms> <compression xmlns=&quot;http://jabber.org/features/compress&quot;> <method>zlib</method> </compression> <auth xmlns=&quot;http://jabber.org/features/iq-auth&quot;/> <register xmlns=&quot;http://jabber.org/features/iq-register&quot;/> </stream:features> -- C2S -- -- TLS による通信開始  -- <starttls xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot;/> -- S2C -- --  サーバが TLS 開始を確認  -- <proceed xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot;/> よくみると,サーバは一度に要求 してるが,クライアントはひとつずつ 応えている
セッション TCP TLS SASL Resource Binding ( user @ domain / resource ) クライアント サーバ < session / > < message / >, < presence / > option メッセージの やりとりをする までに必要な 設定
Psi2OpenFire ( SASL 開設まで) -- C2S -- -- TLS による通信開始  -- <?xml version=&quot;1.0&quot;?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; version=&quot;1.0&quot; xmlns=&quot;jabber:client&quot; to=&quot;foo.hoge.co.jp&quot; xml:lang=&quot;en&quot; xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; > -- S2C -- --  サーバからの応答開始  -- <?xml version='1.0' encoding='UTF-8'?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; xmlns=&quot;jabber:client&quot; from=&quot;foo.hoge.co.jp&quot; id=&quot;b9a694d9&quot; xml:lang=&quot;en&quot; version=&quot;1.0&quot;> -- S2C -- -- SASL 要求  -- <stream:features> <mechanisms xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;> <mechanism>PLAIN</mechanism> <mechanism>CRAM-MD5</mechanism> <mechanism>ANONYMOUS</mechanism> <mechanism>DIGEST-MD5</mechanism> </mechanisms> <compression xmlns=&quot;http://jabber.org/features/compress&quot;> <method>zlib</method> </compression> <auth xmlns=&quot;http://jabber.org/features/iq-auth&quot;/> <register xmlns=&quot;http://jabber.org/features/iq-register&quot;/> </stream:features> -- C2S -- <auth xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl“ mechanism=&quot;DIGEST-MD5&quot; /> -- S2C -- <challenge xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>...</challenge> -- C2S -- --  クライアントがレスポンスを送信  -- <response xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>...</response> -- S2C -- --  サーバが認証成功宣言  -- <success xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>...</success> GTalk は SSL を使ってるので TLS での通信要求はでない
セッション TCP TLS SASL Resource Binding ( user @ domain / resource ) クライアント サーバ < session / > < message / >, < presence / > option メッセージの やりとりをする までに必要な 設定
Psi2OpenFire (圧縮モード設定まで) -- C2S -- -- SASL ベースで再度アクセス  -- <?xml version=&quot;1.0&quot;?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; version=&quot;1.0&quot; xmlns=&quot;jabber:client&quot; to=&quot;foo.hoge.co.jp&quot; xml:lang=&quot;en&quot; xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; > -- S2C -- --  サーバ応答  -- <?xml version='1.0' encoding='UTF-8'?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; xmlns=&quot;jabber:client&quot; from=&quot;foo.hoge.co.jp&quot; id=&quot;b9a694d9&quot; xml:lang=&quot;en&quot; version=&quot;1.0&quot;> -- S2C -- -- traffic を圧縮するかどうかを確認してる  -- -- Psi で &quot;Compress traffic&quot; にチェックしてないので無反応  -- <stream:features> <compression xmlns=&quot;http://jabber.org/features/compress&quot;> <method>zlib</method> </compression> <bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;/> <session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/> </stream:features>
Psi2OpenFire ( Roster 取得まで) -- C2S -- -- Client asks server to bind a resource: -- -- RFC3920 7. Resource Binding -- <iq type=&quot;set&quot; id=&quot;bind_1&quot; > <bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;> <resource>Psi</resource> </bind> </iq> -- S2C -- -- Server informs client of successful resource binding: -- -- RFC3920 7. Resource Binding -- <iq xmlns=&quot;jabber:client&quot; type=&quot;result&quot; id=&quot;bind_1&quot; to=&quot;foo.hoge.co.jp/b9a694d9&quot; > <bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;> <jid> daiba@foo.hoge.co.jp/Psi </jid> </bind> </iq> -- C2S -- -- Client requests session with server: -- -- RFC3921 3. Session Establishment -- <iq type=&quot;set&quot; id=&quot;aab5a&quot; > <session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/> </iq> -- S2C -- --Server informs client that session has been created -- --  この段階で &quot;active resource&quot; としてサーバに登録された  -- <iq type=&quot;result&quot; id=&quot;aab5a&quot; to=&quot;daiba@foo.hoge.co.jp/Psi&quot; > <session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/> </iq> -- C2S -- -- Client requests current roster from server: -- -- 7.3. Retrieving One's Roster on Login -- <iq type=&quot;get&quot; id=&quot;aab6a&quot; > <query xmlns=&quot;jabber:iq:roster&quot;/> </iq> -- S2C -- -- Client receives roster from server: -- <iq type=&quot;result&quot; id=&quot;aab6a&quot; to=&quot;daiba@foo.hoge.co.jp/Psi&quot; > <query xmlns=&quot;jabber:iq:roster&quot;/> </iq> resource  ってのは, [email_address]  / Psi  の “  Psi “  の部分
Psi2OpenFire ( Priority 設定まで) -- C2S -- -- Presence priority: -- -- RFC3921 5.4. Specifying Presence Priority -- <presence> <priority>5</priority> <c xmlns=&quot;http://jabber.org/protocol/caps&quot; node=&quot;http://psi-im.org/caps&quot; ver=&quot;0.11-dev-rev8&quot; ext=&quot;cs ep-notify html&quot; /> </presence>
Psi2GoogleTalk ( Roster 取得) -- C2S -- -- Client requests current roster from server: -- -- 7.3. Retrieving One's Roster on Login -- <iq type=&quot;get&quot; id=&quot;aab6a&quot; > <query xmlns=&quot;jabber:iq:roster&quot;/> </iq> -- S2C -- -- Client receives roster from server: -- <iq type=&quot;result&quot; to=&quot;daibak@gmail.com/griffin9EB3DE9D&quot; id=&quot;aab6a&quot; > <query xmlns=&quot;jabber:iq:roster&quot;> <item subscription=“both” name=“ 誰か &quot; jid=“noname@gmail.com&quot; /> <item subscription=&quot;both&quot; jid=&quot;twitter@twitter.com&quot; /> <item subscription=&quot;both&quot; jid=&quot;jaiku@jaiku.com&quot; > <group>Buddies</group> </item> </query> </iq>
Psi2GoogleTalk ( vCard 取得) -- C2S -- -- vCard Action: Resulting Stanza -- -- XEP-0054 6.2 URI Query Types -- <iq type=&quot;get&quot; to=&quot;daibak@gmail.com&quot; id=&quot;aab9a&quot; > <vCard xmlns=&quot;vcard-temp“ version=&quot;2.0“ prodid=&quot;-//HandGen//NONSGML vGen v1.0//EN&quot; /> </iq> <iq from= [email_address] type=&quot;result“ to=daibak@gmail.com/griffin9EB3DE9D id=&quot;aab9a&quot; > <vCard xmlns=&quot;vcard-temp&quot;> <FN>Keiichi daiba</FN> <PHOTO> <TYPE>image/jpeg</TYPE> <BINVAL>...</BINVAL> </PHOTO> </vCard> </iq> バイナリデータをBasa64? 変換して埋め込んである
Psi2GoogleTalk (メッセージ送受信) -- BOT  にメッセージを送る  -- <message type=&quot;chat&quot; to=&quot;en2ja@bot.talk.google.com&quot; id=&quot;aabea&quot; > <body>general</body> <active xmlns=&quot;http://jabber.org/protocol/chatstates&quot;/> </message> <message from=&quot;en2ja@bot.talk.google.com&quot; type=&quot;chat&quot; to=&quot;daibak@gmail.com/griffinEB79CC3A&quot; > <body> 全般 </body> </message>
Psi2OpenFire (ルーム作成) -- C2S -- --  チャットルーム作成  -- <presence to=&quot;test@ conference .foo.hoge.co.jp/test&quot; > <priority>0</priority> <x xmlns=&quot;http://jabber.org/protocol/muc&quot;> <history maxchars=&quot;0&quot; /> </x> </presence> -- S2C – --  成功  -- <presence from=test@conference.foo.hoge.co.jp/test to=“daiba@foo.hoge.co.jp/Psi&quot; > <priority>0</priority> <x xmlns=&quot;http://jabber.org/protocol/muc#user&quot;> <item affiliation=&quot;owner“ role=&quot;moderator“ jid=“daiba@foo.hoge.co.jp/Psi&quot; /> <status code=&quot;201&quot; /> </x> </presence> “  conference “  は  OpenFire  のデフォルト設定 ルーム名 “  test “ ,ニックネームも “  test “ -- C2S -- <iq type=&quot;set&quot; to=&quot;test@conference.foo.hoge.co.jp&quot; id=&quot;aac1a&quot; > <query xmlns=&quot;http://jabber.org/protocol/muc#owner&quot;> <x xmlns=&quot;jabber:x:data&quot; type=&quot;submit&quot; /> </query> </iq> -- S2C – <message from=test@conference.foo.hoge.co.jp type=&quot;groupchat“ to=“daiba@foo.hoge.co.jp/Psi&quot; > <body> This room is locked from entry until configuration is confirmed. </body> </message> <message from=test@conference.foo.hoge.co.jp type=&quot;groupchat“ to=“daiba@foo.hoge.co.jp/Psi&quot; > <body>This room is now unlocked.</body> </message> 作成した状態ではLOCKされてるので submit してUNLOCK
Psi2OpenFire (設定確認) -- C2S -- --  設定確認 – <iq from=‘daiba@foo.hoge.co.jp/Psi' id='config1' to='test@conference.foo.hoge.co.jp' type='get'> <query  xmlns='http://jabber.org/protocol/muc#owner'/> </iq> -- S2C -- --  確認したデータ  -- <iq from=test@conference.foo.hoge.co.jp type=&quot;result“ id=&quot;config1“ to=“daiba@foo.hoge.co.jp/Psi&quot; > <query xmlns=&quot;http://jabber.org/protocol/muc#owner&quot;> <x xmlns=&quot;jabber:x:data&quot; type=&quot;form&quot; > <title>Room configuration</title> <instructions>...</instructions> <field type=&quot;hidden&quot; var=&quot;FORM_TYPE&quot; > <value>http://jabber.org/protocol/muc#roomconfig</value> </field> <field type=&quot;text-single“ label=&quot;Room Name“ var=&quot;muc#roomconfig_roomname&quot; > <value>test</value> </field> ... <field type=&quot;list-single“ label=&quot;Maximum Room Occupants“ var=&quot;muc#roomconfig_maxusers&quot; > <value>30</value> <option label=&quot;10&quot; > <value>10</value> </option> <option label=&quot;20&quot; > <value>20</value> </option> <option label=&quot;30&quot; > <value>30</value> </option> <option label=&quot;40&quot; > <value>40</value> </option> <option label=&quot;50&quot; > <value>50</value> </option> <option label=&quot;None&quot; > <value>0</value> </option> </field> ... </x> </query> </iq> 初期設定で, 参加可能な人数は30 パラメータを何も 指定しないとすべての 設定を返す
Psi2OpenFire (設定変更) --  設定変更  -- -- C2S -- <iq from=‘daiba@foo.hoge.co.jp/Psi' id='create2' to='test@conference.foo.hoge.co.jp' type='set'> <query xmlns='http://jabber.org/protocol/muc#owner'> <x xmlns='jabber:x:data' type='submit'> <field var='muc#roomconfig_maxusers'> <value>0</value> </field> </x> </query> </iq> -- S2C -- <iq from=test@conference.turk.nttr.co.jp type=&quot;result“ id=&quot;create2“ to=“daiba@foo.hoge.co.jp/Psi&quot; /> Psi  の XML コンソールを使って手動で XML 送信 < value > 0 < / value >  が最大入室無制限

More Related Content

Viewers also liked

Classics
ClassicsClassics
Classics
Ninu
 
The butterfly_The flower
The butterfly_The flowerThe butterfly_The flower
The butterfly_The flower
Ninu
 

Viewers also liked (20)

Evolution of Public Relations Through Content Marketing - Congreso PRORP
Evolution of Public Relations Through Content Marketing - Congreso PRORP  Evolution of Public Relations Through Content Marketing - Congreso PRORP
Evolution of Public Relations Through Content Marketing - Congreso PRORP
 
Convergence: Social Media SEO Content Marketing SES Chicago 2011
Convergence: Social Media SEO Content Marketing SES Chicago 2011Convergence: Social Media SEO Content Marketing SES Chicago 2011
Convergence: Social Media SEO Content Marketing SES Chicago 2011
 
Content Marketing Strategy - The Future is Bright for Web Content
Content Marketing Strategy - The Future is Bright for Web Content Content Marketing Strategy - The Future is Bright for Web Content
Content Marketing Strategy - The Future is Bright for Web Content
 
Classics
ClassicsClassics
Classics
 
The butterfly_The flower
The butterfly_The flowerThe butterfly_The flower
The butterfly_The flower
 
Create Demand and Influence with Co-Created Content for B2B Marketing
Create Demand and Influence with Co-Created Content for B2B MarketingCreate Demand and Influence with Co-Created Content for B2B Marketing
Create Demand and Influence with Co-Created Content for B2B Marketing
 
prova tre
prova treprova tre
prova tre
 
Erlang with Regexp Perl And Port
Erlang with Regexp Perl And PortErlang with Regexp Perl And Port
Erlang with Regexp Perl And Port
 
Content Marketing - How to Optimize & Socialize for Better Performance
Content Marketing  - How to Optimize & Socialize for Better PerformanceContent Marketing  - How to Optimize & Socialize for Better Performance
Content Marketing - How to Optimize & Socialize for Better Performance
 
Atom Pub
Atom PubAtom Pub
Atom Pub
 
[Erlang LT] Regexp Perl And Port
[Erlang LT] Regexp Perl And Port[Erlang LT] Regexp Perl And Port
[Erlang LT] Regexp Perl And Port
 
Content Marketing Optimization - TopRank Marketing
Content Marketing Optimization - TopRank MarketingContent Marketing Optimization - TopRank Marketing
Content Marketing Optimization - TopRank Marketing
 
#Optimize Content & Customers - Search Congress Barcelona
#Optimize Content & Customers - Search Congress Barcelona#Optimize Content & Customers - Search Congress Barcelona
#Optimize Content & Customers - Search Congress Barcelona
 
Drupal101
Drupal101Drupal101
Drupal101
 
Web-Scale Discovery: Post Implementation
Web-Scale Discovery: Post ImplementationWeb-Scale Discovery: Post Implementation
Web-Scale Discovery: Post Implementation
 
Optimized Blogging That Inspires Action
Optimized Blogging That Inspires ActionOptimized Blogging That Inspires Action
Optimized Blogging That Inspires Action
 
prova
provaprova
prova
 
Optimize & Socialize for Better Business Blogging
Optimize & Socialize for Better Business BloggingOptimize & Socialize for Better Business Blogging
Optimize & Socialize for Better Business Blogging
 
aaa
aaaaaa
aaa
 
Amazon Ec2
Amazon Ec2Amazon Ec2
Amazon Ec2
 

Similar to XMPP仕様簡単解説

Struts2を始めよう!
Struts2を始めよう!Struts2を始めよう!
Struts2を始めよう!
Shinpei Ohtani
 
MT meets PHP - PHP conference Kansai 2013
MT meets PHP - PHP conference Kansai 2013MT meets PHP - PHP conference Kansai 2013
MT meets PHP - PHP conference Kansai 2013
純生 野田
 
2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk
mitamex4u
 
Ruby on Rails Tutorial Chapter8-10
Ruby on Rails Tutorial Chapter8-10Ruby on Rails Tutorial Chapter8-10
Ruby on Rails Tutorial Chapter8-10
Sea Mountain
 
エンジニア知識共有会発表資料 20090910
エンジニア知識共有会発表資料 20090910エンジニア知識共有会発表資料 20090910
エンジニア知識共有会発表資料 20090910
ngi group.
 
Perl logging
Perl loggingPerl logging
Perl logging
keroyonn
 

Similar to XMPP仕様簡単解説 (20)

HTML5でセマンティックなマークアップ
HTML5でセマンティックなマークアップHTML5でセマンティックなマークアップ
HTML5でセマンティックなマークアップ
 
Keynote In Japanese
Keynote In JapaneseKeynote In Japanese
Keynote In Japanese
 
Struts2を始めよう!
Struts2を始めよう!Struts2を始めよう!
Struts2を始めよう!
 
実社会で進められているサービスとLOD
実社会で進められているサービスとLOD実社会で進められているサービスとLOD
実社会で進められているサービスとLOD
 
webを飾る技術
webを飾る技術webを飾る技術
webを飾る技術
 
MT meets PHP
MT meets PHPMT meets PHP
MT meets PHP
 
MT meets PHP - PHP conference Kansai 2013
MT meets PHP - PHP conference Kansai 2013MT meets PHP - PHP conference Kansai 2013
MT meets PHP - PHP conference Kansai 2013
 
日常業務にperlを使おう
 日常業務にperlを使おう 日常業務にperlを使おう
日常業務にperlを使おう
 
Module02
Module02Module02
Module02
 
HTML仕様書を読んでみよう
HTML仕様書を読んでみようHTML仕様書を読んでみよう
HTML仕様書を読んでみよう
 
2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk
 
Ruby on Rails Tutorial Chapter8-10
Ruby on Rails Tutorial Chapter8-10Ruby on Rails Tutorial Chapter8-10
Ruby on Rails Tutorial Chapter8-10
 
PHP, Now and Then 2011
PHP, Now and Then 2011PHP, Now and Then 2011
PHP, Now and Then 2011
 
JavaScript&Firebug入門
JavaScript&Firebug入門JavaScript&Firebug入門
JavaScript&Firebug入門
 
Code Igniterについて
Code IgniterについてCode Igniterについて
Code Igniterについて
 
エンジニア知識共有会発表資料 20090910
エンジニア知識共有会発表資料 20090910エンジニア知識共有会発表資料 20090910
エンジニア知識共有会発表資料 20090910
 
Inside Movable Type
Inside Movable TypeInside Movable Type
Inside Movable Type
 
Let's make your CDN with RUBY
Let's make your CDN with RUBYLet's make your CDN with RUBY
Let's make your CDN with RUBY
 
URLで遊ぼう
URLで遊ぼうURLで遊ぼう
URLで遊ぼう
 
Perl logging
Perl loggingPerl logging
Perl logging
 

XMPP仕様簡単解説

  • 1.  
  • 2.
  • 3. JID 各パーツは 1023B 以下 “ @ “ とか “ / “ とかも含めて 3071B 以下 IPv4address / IPv6address = address-literal ( internationalized domain label ) = sub-domain ( sub-domain 1 * ( “ . “ sub-domain ) ) = fqdn fqdn / address-literal = domain [ node “ @ ” ] domain [ “ / ” resource ] = jid
  • 4.
  • 5.
  • 6. セッション TCP TLS SASL Resource Binding ( user @ domain / resource ) クライアント サーバ < session / > < message / >, < presence / > option メッセージの やりとりをする までに必要な 設定
  • 7.
  • 8. IQ ( Info / Query ) syntax Requesting Entity Responding Entity < iq type = ‘ get ‘ id = ‘ 1 ‘ > < iq type = ‘ result ‘ id = ‘ 1 ‘ > < iq type = ‘ set ‘ id = ‘ 2 ‘ > < iq type = ‘ error ‘ id = ‘ 2 ‘ > type 属性は4 種類 理由がない限り必須 id 属性も理由がない限り必須
  • 9.
  • 10. Psi2OpenFire ( TLS 開設まで) -- C2S— <?xml version=&quot;1.0&quot;?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; version=&quot;1.0&quot; xmlns=&quot;jabber:client&quot; to=&quot;foo.hoge.co.jp&quot; xml:lang=&quot;en&quot; xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; > -- S2C -- <?xml version='1.0' encoding='UTF-8'?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; xmlns=&quot;jabber:client&quot; from=&quot;foo.hoge.co.jp&quot; id=&quot;b9a694d9&quot; xml:lang=&quot;en&quot; version=&quot;1.0&quot;> -- S2C -- -- TLS による通信要求 -- <stream:features> <starttls xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot;/> <mechanisms xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;> <mechanism>PLAIN</mechanism> <mechanism>CRAM-MD5</mechanism> <mechanism>ANONYMOUS</mechanism> <mechanism>DIGEST-MD5</mechanism> </mechanisms> <compression xmlns=&quot;http://jabber.org/features/compress&quot;> <method>zlib</method> </compression> <auth xmlns=&quot;http://jabber.org/features/iq-auth&quot;/> <register xmlns=&quot;http://jabber.org/features/iq-register&quot;/> </stream:features> -- C2S -- -- TLS による通信開始 -- <starttls xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot;/> -- S2C -- -- サーバが TLS 開始を確認 -- <proceed xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot;/> よくみると,サーバは一度に要求 してるが,クライアントはひとつずつ 応えている
  • 11. セッション TCP TLS SASL Resource Binding ( user @ domain / resource ) クライアント サーバ < session / > < message / >, < presence / > option メッセージの やりとりをする までに必要な 設定
  • 12. Psi2OpenFire ( SASL 開設まで) -- C2S -- -- TLS による通信開始 -- <?xml version=&quot;1.0&quot;?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; version=&quot;1.0&quot; xmlns=&quot;jabber:client&quot; to=&quot;foo.hoge.co.jp&quot; xml:lang=&quot;en&quot; xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; > -- S2C -- -- サーバからの応答開始 -- <?xml version='1.0' encoding='UTF-8'?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; xmlns=&quot;jabber:client&quot; from=&quot;foo.hoge.co.jp&quot; id=&quot;b9a694d9&quot; xml:lang=&quot;en&quot; version=&quot;1.0&quot;> -- S2C -- -- SASL 要求 -- <stream:features> <mechanisms xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;> <mechanism>PLAIN</mechanism> <mechanism>CRAM-MD5</mechanism> <mechanism>ANONYMOUS</mechanism> <mechanism>DIGEST-MD5</mechanism> </mechanisms> <compression xmlns=&quot;http://jabber.org/features/compress&quot;> <method>zlib</method> </compression> <auth xmlns=&quot;http://jabber.org/features/iq-auth&quot;/> <register xmlns=&quot;http://jabber.org/features/iq-register&quot;/> </stream:features> -- C2S -- <auth xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl“ mechanism=&quot;DIGEST-MD5&quot; /> -- S2C -- <challenge xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>...</challenge> -- C2S -- -- クライアントがレスポンスを送信 -- <response xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>...</response> -- S2C -- -- サーバが認証成功宣言 -- <success xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>...</success> GTalk は SSL を使ってるので TLS での通信要求はでない
  • 13. セッション TCP TLS SASL Resource Binding ( user @ domain / resource ) クライアント サーバ < session / > < message / >, < presence / > option メッセージの やりとりをする までに必要な 設定
  • 14. Psi2OpenFire (圧縮モード設定まで) -- C2S -- -- SASL ベースで再度アクセス -- <?xml version=&quot;1.0&quot;?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; version=&quot;1.0&quot; xmlns=&quot;jabber:client&quot; to=&quot;foo.hoge.co.jp&quot; xml:lang=&quot;en&quot; xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; > -- S2C -- -- サーバ応答 -- <?xml version='1.0' encoding='UTF-8'?> <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; xmlns=&quot;jabber:client&quot; from=&quot;foo.hoge.co.jp&quot; id=&quot;b9a694d9&quot; xml:lang=&quot;en&quot; version=&quot;1.0&quot;> -- S2C -- -- traffic を圧縮するかどうかを確認してる -- -- Psi で &quot;Compress traffic&quot; にチェックしてないので無反応 -- <stream:features> <compression xmlns=&quot;http://jabber.org/features/compress&quot;> <method>zlib</method> </compression> <bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;/> <session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/> </stream:features>
  • 15. Psi2OpenFire ( Roster 取得まで) -- C2S -- -- Client asks server to bind a resource: -- -- RFC3920 7. Resource Binding -- <iq type=&quot;set&quot; id=&quot;bind_1&quot; > <bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;> <resource>Psi</resource> </bind> </iq> -- S2C -- -- Server informs client of successful resource binding: -- -- RFC3920 7. Resource Binding -- <iq xmlns=&quot;jabber:client&quot; type=&quot;result&quot; id=&quot;bind_1&quot; to=&quot;foo.hoge.co.jp/b9a694d9&quot; > <bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;> <jid> daiba@foo.hoge.co.jp/Psi </jid> </bind> </iq> -- C2S -- -- Client requests session with server: -- -- RFC3921 3. Session Establishment -- <iq type=&quot;set&quot; id=&quot;aab5a&quot; > <session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/> </iq> -- S2C -- --Server informs client that session has been created -- -- この段階で &quot;active resource&quot; としてサーバに登録された -- <iq type=&quot;result&quot; id=&quot;aab5a&quot; to=&quot;daiba@foo.hoge.co.jp/Psi&quot; > <session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/> </iq> -- C2S -- -- Client requests current roster from server: -- -- 7.3. Retrieving One's Roster on Login -- <iq type=&quot;get&quot; id=&quot;aab6a&quot; > <query xmlns=&quot;jabber:iq:roster&quot;/> </iq> -- S2C -- -- Client receives roster from server: -- <iq type=&quot;result&quot; id=&quot;aab6a&quot; to=&quot;daiba@foo.hoge.co.jp/Psi&quot; > <query xmlns=&quot;jabber:iq:roster&quot;/> </iq> resource ってのは, [email_address] / Psi の “ Psi “ の部分
  • 16. Psi2OpenFire ( Priority 設定まで) -- C2S -- -- Presence priority: -- -- RFC3921 5.4. Specifying Presence Priority -- <presence> <priority>5</priority> <c xmlns=&quot;http://jabber.org/protocol/caps&quot; node=&quot;http://psi-im.org/caps&quot; ver=&quot;0.11-dev-rev8&quot; ext=&quot;cs ep-notify html&quot; /> </presence>
  • 17. Psi2GoogleTalk ( Roster 取得) -- C2S -- -- Client requests current roster from server: -- -- 7.3. Retrieving One's Roster on Login -- <iq type=&quot;get&quot; id=&quot;aab6a&quot; > <query xmlns=&quot;jabber:iq:roster&quot;/> </iq> -- S2C -- -- Client receives roster from server: -- <iq type=&quot;result&quot; to=&quot;daibak@gmail.com/griffin9EB3DE9D&quot; id=&quot;aab6a&quot; > <query xmlns=&quot;jabber:iq:roster&quot;> <item subscription=“both” name=“ 誰か &quot; jid=“noname@gmail.com&quot; /> <item subscription=&quot;both&quot; jid=&quot;twitter@twitter.com&quot; /> <item subscription=&quot;both&quot; jid=&quot;jaiku@jaiku.com&quot; > <group>Buddies</group> </item> </query> </iq>
  • 18. Psi2GoogleTalk ( vCard 取得) -- C2S -- -- vCard Action: Resulting Stanza -- -- XEP-0054 6.2 URI Query Types -- <iq type=&quot;get&quot; to=&quot;daibak@gmail.com&quot; id=&quot;aab9a&quot; > <vCard xmlns=&quot;vcard-temp“ version=&quot;2.0“ prodid=&quot;-//HandGen//NONSGML vGen v1.0//EN&quot; /> </iq> <iq from= [email_address] type=&quot;result“ to=daibak@gmail.com/griffin9EB3DE9D id=&quot;aab9a&quot; > <vCard xmlns=&quot;vcard-temp&quot;> <FN>Keiichi daiba</FN> <PHOTO> <TYPE>image/jpeg</TYPE> <BINVAL>...</BINVAL> </PHOTO> </vCard> </iq> バイナリデータをBasa64? 変換して埋め込んである
  • 19. Psi2GoogleTalk (メッセージ送受信) -- BOT にメッセージを送る -- <message type=&quot;chat&quot; to=&quot;en2ja@bot.talk.google.com&quot; id=&quot;aabea&quot; > <body>general</body> <active xmlns=&quot;http://jabber.org/protocol/chatstates&quot;/> </message> <message from=&quot;en2ja@bot.talk.google.com&quot; type=&quot;chat&quot; to=&quot;daibak@gmail.com/griffinEB79CC3A&quot; > <body> 全般 </body> </message>
  • 20. Psi2OpenFire (ルーム作成) -- C2S -- -- チャットルーム作成 -- <presence to=&quot;test@ conference .foo.hoge.co.jp/test&quot; > <priority>0</priority> <x xmlns=&quot;http://jabber.org/protocol/muc&quot;> <history maxchars=&quot;0&quot; /> </x> </presence> -- S2C – -- 成功 -- <presence from=test@conference.foo.hoge.co.jp/test to=“daiba@foo.hoge.co.jp/Psi&quot; > <priority>0</priority> <x xmlns=&quot;http://jabber.org/protocol/muc#user&quot;> <item affiliation=&quot;owner“ role=&quot;moderator“ jid=“daiba@foo.hoge.co.jp/Psi&quot; /> <status code=&quot;201&quot; /> </x> </presence> “ conference “ は OpenFire のデフォルト設定 ルーム名 “ test “ ,ニックネームも “ test “ -- C2S -- <iq type=&quot;set&quot; to=&quot;test@conference.foo.hoge.co.jp&quot; id=&quot;aac1a&quot; > <query xmlns=&quot;http://jabber.org/protocol/muc#owner&quot;> <x xmlns=&quot;jabber:x:data&quot; type=&quot;submit&quot; /> </query> </iq> -- S2C – <message from=test@conference.foo.hoge.co.jp type=&quot;groupchat“ to=“daiba@foo.hoge.co.jp/Psi&quot; > <body> This room is locked from entry until configuration is confirmed. </body> </message> <message from=test@conference.foo.hoge.co.jp type=&quot;groupchat“ to=“daiba@foo.hoge.co.jp/Psi&quot; > <body>This room is now unlocked.</body> </message> 作成した状態ではLOCKされてるので submit してUNLOCK
  • 21. Psi2OpenFire (設定確認) -- C2S -- -- 設定確認 – <iq from=‘daiba@foo.hoge.co.jp/Psi' id='config1' to='test@conference.foo.hoge.co.jp' type='get'> <query xmlns='http://jabber.org/protocol/muc#owner'/> </iq> -- S2C -- -- 確認したデータ -- <iq from=test@conference.foo.hoge.co.jp type=&quot;result“ id=&quot;config1“ to=“daiba@foo.hoge.co.jp/Psi&quot; > <query xmlns=&quot;http://jabber.org/protocol/muc#owner&quot;> <x xmlns=&quot;jabber:x:data&quot; type=&quot;form&quot; > <title>Room configuration</title> <instructions>...</instructions> <field type=&quot;hidden&quot; var=&quot;FORM_TYPE&quot; > <value>http://jabber.org/protocol/muc#roomconfig</value> </field> <field type=&quot;text-single“ label=&quot;Room Name“ var=&quot;muc#roomconfig_roomname&quot; > <value>test</value> </field> ... <field type=&quot;list-single“ label=&quot;Maximum Room Occupants“ var=&quot;muc#roomconfig_maxusers&quot; > <value>30</value> <option label=&quot;10&quot; > <value>10</value> </option> <option label=&quot;20&quot; > <value>20</value> </option> <option label=&quot;30&quot; > <value>30</value> </option> <option label=&quot;40&quot; > <value>40</value> </option> <option label=&quot;50&quot; > <value>50</value> </option> <option label=&quot;None&quot; > <value>0</value> </option> </field> ... </x> </query> </iq> 初期設定で, 参加可能な人数は30 パラメータを何も 指定しないとすべての 設定を返す
  • 22. Psi2OpenFire (設定変更) -- 設定変更 -- -- C2S -- <iq from=‘daiba@foo.hoge.co.jp/Psi' id='create2' to='test@conference.foo.hoge.co.jp' type='set'> <query xmlns='http://jabber.org/protocol/muc#owner'> <x xmlns='jabber:x:data' type='submit'> <field var='muc#roomconfig_maxusers'> <value>0</value> </field> </x> </query> </iq> -- S2C -- <iq from=test@conference.turk.nttr.co.jp type=&quot;result“ id=&quot;create2“ to=“daiba@foo.hoge.co.jp/Psi&quot; /> Psi の XML コンソールを使って手動で XML 送信 < value > 0 < / value > が最大入室無制限