No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0151.xml 58KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Virtual Presence</title>
  10. <abstract>This document proposes extensions to the Jabber groupchat protocol for virtual presence on Web pages.</abstract>
  11. &LEGALNOTICE;
  12. <number>0151</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0045</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>Not yet assigned</shortname>
  23. <author>
  24. <firstname>Heiner</firstname>
  25. <surname>Wolf</surname>
  26. <email>wolf@bluehands.de</email>
  27. <jid>wolfspelz@jabber.bluehands.de</jid>
  28. </author>
  29. <revision>
  30. <version>0.2</version>
  31. <date>2005-07-05</date>
  32. <initials>hw</initials>
  33. <remark><p>Simplified VPI file and rule syntax, basically omitting the rule/search/replace tags.</p></remark>
  34. </revision>
  35. <revision>
  36. <version>0.1</version>
  37. <date>2005-06-02</date>
  38. <initials>psa</initials>
  39. <remark><p>Initial version.</p></remark>
  40. </revision>
  41. <revision>
  42. <version>0.0.8</version>
  43. <date>2005-05-20</date>
  44. <initials>hw</initials>
  45. <remark><p>Added ignore-tag.</p></remark>
  46. </revision>
  47. <revision>
  48. <version>0.0.7</version>
  49. <date>2005-02-08</date>
  50. <initials>hw</initials>
  51. <remark><p>Added comments on anonymity of presence element JID.
  52. Added additional avatar retrieval methods: 1. presence stanza avatar data element 2. via disco</p></remark>
  53. </revision>
  54. <revision>
  55. <version>0.0.6</version>
  56. <date>2005-01-26</date>
  57. <initials>hw</initials>
  58. <remark><p>Replaced firebat:chat:key by firebat:chat:state</p></remark>
  59. </revision>
  60. <revision>
  61. <version>0.0.5</version>
  62. <date>2004-07-29</date>
  63. <initials>hw</initials>
  64. <remark><p>Notes about future changes in the JID/storage related sections.</p></remark>
  65. </revision>
  66. <revision>
  67. <version>0.0.4</version>
  68. <date>2004-07-27</date>
  69. <initials>hw</initials>
  70. <remark><p>Changed avatar position request frem message-x to iq-get, because MUC may block unknown message namespaces.</p></remark>
  71. </revision>
  72. <revision>
  73. <version>0.0.3</version>
  74. <date>2004-03-17</date>
  75. <initials>hw</initials>
  76. <remark><p>Textual changes. Added service tag to rule to overwrite default service of the location.</p></remark>
  77. </revision>
  78. <revision>
  79. <version>0.0.2</version>
  80. <date>2003-11-19</date>
  81. <initials>hw</initials>
  82. <remark><p>Refined introduction and requirements. Added location mapping.</p></remark>
  83. </revision>
  84. <revision>
  85. <version>0.0.1</version>
  86. <date>2003-11-11</date>
  87. <initials>hw</initials>
  88. <remark><p>Initial version.</p></remark>
  89. </revision>
  90. </header>
  91. <section1 topic='Introduction'>
  92. <p>Virtual presence on Web pages (also sometimes known as co-browsing, while co-browsing can also mean something different) makes people aware of each other, who are at the same Web location at the same time. The basic purpose of a virtual presence system is to show names, icons, and/or avatars of people who are on a page or a set of pages and to let them communicate. This document proposes extensions to the Jabber protocol, which enable neat virtual presence on Web pages. The extensions are implemented as namespaces for the protocol elements &IQ;, &PRESENCE;, &MESSAGE;, and for server storage. </p>
  93. <p>This document also covers the mapping of URLs to Jabber chat rooms. It describes step by step how clients derive virtual locations from URLs of web pages. The process includes queries to the web server, queries to default configuration sources, delegation between configuration sets, ways for administrators of websites to opt out, and methods to shape the virtual space actively by clustering together or splitting off URL groups.</p>
  94. <p>This document describes an implementation that proved to be useful over one year. We propose the extensions, but we are open to comments and other proposals, if readers think that different approaches would better fit into the Jabber architecture. This also applies to namespaces, especially since the extensions where designed while the Jabber community was moving to URL-style namespaces. So did this implementation.</p>
  95. </section1>
  96. <section1 topic='Requirements'>
  97. <section2 topic='Interaction on Virtual Locations'>
  98. <p>Meeting on virtual locations is very similar to meeting peers in a public chat room. But web pages can be regarded as 2 dimensional. They very often cover the entire screen. They use graphics elements for their content. Plainly speaking: representing users as figures or other images fits well to web pages. Once they are shown as individual figures, a line based chat and a chat window are not required any more (though a chat window can still be used). The figures can move around and talk in chat bubble style. Chat bubbles in turn enable incremental chat.</p>
  99. <p>This document describes protocol elements for:</p>
  100. <ul>
  101. <li>the visualization of users on web pages (animated avatars) and</li>
  102. <li>communication beyond line based group chat (incremental or instant bubble chat)</li>
  103. </ul>
  104. <p>While users are browsing the web, they enter and leave many rooms. They meet many people and some of them multiple times. Minimum overall traffic and minimum traffic on the user connection are primary design goals. The user connection is limited by typical karma settings of jabber servers. Logging in to virtual locations (rooms) must be quick in terms of round trips and cheap in terms of traffic. Once logged in to a room, the traffic on the user connection should be independent of the number of peers already present. </p>
  105. <p>The extensions have been designed to be:</p>
  106. <ul>
  107. <li>compatible to the existing Jabber infrastructure and protocols,</li>
  108. <li>lightweight with respect to the number of new elements,</li>
  109. <li>lightweight with respect to the traffic generated.</li>
  110. </ul>
  111. <p>The traffic goals can be met by using only the initial &PRESENCE; stanza, which carries all required information, so that no peer-to-peer messages are required on entering. VP clients which gather additional information about peers (e.g. avatar images) should cache the data so that it can be re-used. This is especially important since users browsing virtually connected locations (i.e. linked pages) may meet very often in a short time.</p>
  112. <p>The virtual presence extensions make use of Jabber group chat. Virtual locations are implemented as public Jabber chat channels. The proposed protocol works with &xep0045; rooms and GroupChat 1.0 compatible services. Its core functionality described here uses only groupchat features.</p>
  113. <p>The virtual presence extensions are supposed to be implemented by Jabber IM clients in addition to the IM functions or by pure virtual presence (Jabber VP) clients.</p>
  114. </section2>
  115. <section2 topic='Discovering Virtual Locations'>
  116. <p>The virtual presence network is a distributed network of Jabber conference components. Each component is hosting a part of the Web. Conference components may be specifically set up for virtual locations, or they may run chat rooms for virtual locations in addition to other rooms. A website may choose to run a conference component to host the presence on its web pages or it may use a publicly available service. Websites, which do not care, are covered by default servers, while others may opt out entirely in order to avoid virtual presence on their pages. </p>
  117. <p>Usually VP clients gather URLs from active web browsers. They convert these URLs to Jabber chat rooms IDs (JIDs) using web server specific and general rules for the mapping process. Then they enter the room as described in the section &apos;Example of a Virtual Meeting&apos;. There are many different types of URLs. Many are based on file system paths, others are query style, or a mix of path and query. Sometimes users regard individual pages as locations, sometimes a &apos;location&apos; consists of multiple pages. Large websites may even consist of multiple DNS names, so that users expect to be at the same location regardless of the actual server name.</p>
  118. <p>Usually website operators will not care about virtual presence on their pages. But once there is a significant amount of chat on their pages, they want to control what happens there. In other words: they need to be able to enforce domestic authority on their pages and even expel visitors from &apos;their&apos; chat. They will install moderators (persons or software). Moderators authorized by the website might operate on public chat servers, but control is only guaranteed, if a website controls the assignment of moderators by running the chat server. Hence, website operators must be able to control the mapping process so that they can assign chat server addresses (and chat room names) to URLs. Many websites are hierarchical, with sub-folders being managed by different independent owners. The mapping process should allow for detailed mapping rules for sub-folders and general rules closer to the root of websites, so that the &apos;inner&apos; config prevails. </p>
  119. <p>The mapping process is controlled by configuration files. The files will be downloaded from websites and/or from a default location. Most websites do not know about virtual presence and if they know, then they do not care. Therefore, the mapping process should be designed to allow for virtual presence without cooperation of the website. A default configuration with a simple standard mapping will be used if a website does not provide mapping rules. </p>
  120. <p>Configuration files for the mapping process will often be downloaded over the network. Since the data for multiple virtual locations might add up to large files, the configuration can be split up into individual documents. The splitting is managed by delegation to other config files for subsets of URLs. This is especially important for the default configuration, which may cover special rules for prominent websites.</p>
  121. <p>Global fallback servers are not able to carry all the enter/leave and chat traffic. The virtual presence of many users on many websites demands commercial services for virtual presence hosting. Much like web hosters provide disk space, traffic and processing power, there are commercial (or free) presence hosting services, which provide traffic and processing power. Website operators will either run their own presence servers or rely on commercial services. Commercial operators are limiting the ad-hoc creation of chat rooms for virtual presence or they allow static rooms only. Website operators encode the 'rented' room JID into their mapping configuration. They might even delegate the handling of configuration files entirely to the presence server operator by means of config file delegation.</p>
  122. <p>The mapping process should try to protect the privacy of the user. After all, virtual presence is a violation of privacy in general, because people know where other people are (virtually). This is critical, if compared to the totally un-observed Web without virtual presence. In the real world people are used to being seen in physical locations, but only by others who are physically present in the same location. The mapping process should emulate this restriction. The general idea is to include a one way function (message digest) during the mapping process to prohibit the discovery of &apos;interesting&apos; chat room names. In other words: observers must do the forward mapping and enter a room to see who is there or discover random room names without being able to re-create the source URL. So, they may be able to find people in random rooms, but do not know the virtual location.</p>
  123. <p>This mapping process is designed to:</p>
  124. <ul>
  125. <li>make the virtual presence service a distributed network of jabber servers, i.e. conference components,</li>
  126. <li>allow for flexible mapping from URLs to JIDs, taking into account that
  127. <ul>
  128. <li>most URLs are path based,</li>
  129. <li>URLs contain queries,</li>
  130. <li>sometimes only the query part defines the virtual location,</li>
  131. <li>groups of URLs map to a single JID,</li>
  132. <li>a single virtual location may comprise multiple web servers,</li>
  133. <li>groups of URLs may only cover a sub-folder of path based URLs,</li>
  134. <li>not all URLs are known at config time,</li>
  135. </ul>
  136. </li>
  137. <li>allow operators of websites to control the mapping for the URL-space they control,</li>
  138. <li>let websites opt out of virtual presence,</li>
  139. <li>allow for hierarchical configuration for file system path based URLs,</li>
  140. <li>support delegation,</li>
  141. <li>allow for virtual presence without the cooperation of the website,</li>
  142. <li>allow for distribution of the load of the default configuration server,</li>
  143. <li>support commercial virtual presence servers and rented rooms,</li>
  144. <li>be extensible to other protocols as virtual presence transport,</li>
  145. <li>be easily implemented by website operators,</li>
  146. <li>at least limit the privacy issues associated with virtual presence.</li>
  147. </ul>
  148. </section2>
  149. </section1>
  150. <section1 topic='Example of a Virtual Meeting'>
  151. <p>Since it has been suggested that the use of Shakespeare characters might please the reader we will try to employ them without really knowing the works of Shakespeare. Two characters called Romeo and Juliet will appear. Both will be equipped with a Web browser and a virtual presence Jabber client which implements the protocol extensions described in this document (called VP client in the following). The communication is shown as seen by the conference component including &apos;from&apos; attributes.</p>
  152. <section2 topic='Meeting on Virtual Locations'>
  153. <p>This shows how the first meeting of Romeo and Juliet would have happened if they had known Cyberspace, i.e. the Web. Romeo browses the Web with his favorite web client. He reads the page http://www.shakespeare.com/market/ModernLibrary/page1.html. He is also running a VP client. There is no mention of a buddy list jabber client at this point. The VP client is properly logged in to the Jabber server using the JID romeo@montague.net. Through some magic, the VP client acquires the URL of the current web page. The VP client converts the URL into the JID of a public chat room (see section &apos;Virtual Locations&apos;). The JID will usually be a SHA1 digest of the URL prefixed to a conference component (like f4eb29410ec339144633773dda1dc4a643513933@shakespeare.com). For the sake of readability we will refer to the chat room as room1@shakespeare.com. The VP client then enters the room using &apos;YoungHero&apos; as the nickname.</p>
  154. <example caption='Entering a virtual location'><![CDATA[
  155. <presence from='romeo@montague.net/garden' to='room1@shakespeare.com/YoungHero' />]]>
  156. </example>
  157. <p>The room responds:</p>
  158. <example caption='Acknowledgement of the entry'><![CDATA[
  159. <presence from='room1@shakespeare.com/YoungHero' to='romeo@montague.net/garden' />]]>
  160. </example>
  161. <p>Upon reception the VP client visualizes the presence of Romeo at the location to Romeo, e.g. by displaying Romeo&apos;s icon and/or nickname on, at, or close to the web page. In other words: the VP client shows an avatar of Romeo on the page.</p>
  162. <p>Dramatic increases when Juliet browses to the same web page. Her VP client also gathers the URL, performs the same mapping and enters the room. It sends a &PRESENCE; stanza to the room using nickname &apos;WebGirl&apos;. The room as expected returns the acknowledgement. In addition the room forwards both &PRESENCE; stanzas to the VP clients in order to announce the mutual presence. </p>
  163. <p>Romeo gets:</p>
  164. <example caption='Announcement of peer presence'><![CDATA[
  165. <presence from='room1@shakespeare.com/WebGirl' to='romeo@montague.net/garden' />]]>
  166. </example>
  167. <p>Juliet gets the equivalent. Romeo&apos;s VP client shows Juliet&apos;s presence by adding a second avatar to the page. They now engage in a vivid conversation. In deviation to the original text Juliet would not ask &quot;Who art thou, Romeo?&quot;, because she only knows the nickname and on the other hand she actually knows where Romeo is: he is on the same web page. There is nothing new until now. Everything happened according to GroupChat 1.0 (XEP-0045) without MUC features. Of course, users can join the same room with any client that supports GroupChat, if they know the room&apos;s JID.</p>
  168. <p>Extensions come into the play in order to make the virtual presence more attractive and more vivid.</p>
  169. </section2>
  170. <section2 topic='Getting more information'>
  171. <p>For more information about &apos;YoungHero&apos; beyond the nickname Juliet needs a JID (see below for anonymous variants of the avatar image). Non-anonymous rooms will supply the JIDs automatically. But we suggest that rooms, which make up the virtual presence network are configured to be anonymous so that users can choose if they want to disclose the JID. We propose an extension to the &PRESENCE; stanza for users to supply their JID automatically to peers in anonymous rooms with minimum traffic even for many participants. </p>
  172. <p>Note: even though Romeo sends a JID, the systems is still anonymous. Romeo could send any JID. He may send a (fake) JID that is just the base address of his storage, but not his communication address. In anonymous rooms Juliet will use any JID Romeo provides. If the room is not anonymous, then Romeo&apos;s client may use Juliet&apos;s actual JID. </p>
  173. <p>Entering the room Juliet would add a JID-element to the initial &PRESENCE; stanza.</p>
  174. <example caption='Disclosing the JID'><![CDATA[
  175. <presence from='juliet@capulet.com/balcony' to='room1@shakespeare.com/WebGirl'
  176. <x xmlns='firebat:user:jid'>juliet@capulet.com/balcony</x>
  177. </presence>]]>
  178. </example>
  179. <p>(Note: &apos;firebat&apos; was the developer name of the VP client. Jabber.org URIs could be used here)</p>
  180. <p>This tells the conference component to send the JID to all participants automatically. Romeo will receive the &PRESENCE; stanza including the JID element. Romeo may now fetch Juliet&apos;s avatar or add Juliet to a buddy list. </p>
  181. <p>Note: disclosing the JID is usually not advisable in public rooms. We decided to offer the functionality as an option, for 2 reasons:</p>
  182. <ol>
  183. <li>to provide access to extended information from peers without cluttering the &PRESENCE; stanza more than necessary,</li>
  184. <li>to allow for caching of extended information.</li>
  185. </ol>
  186. <p>Caching requires a persistent and unique id per user. While a message digest of the JID would be sufficient for caching extended information, it is not sufficient for retrieving extended information.</p>
  187. </section2>
  188. <section2 topic='Avatars'>
  189. <p>Romeo will be much more interested in Juliet if Juliet is depicted by a nice image rather than only a name. Users may choose avatars, publish those avatars, and change them on the fly. Changes to the avatar are tracked by comparing a stored digest of the avatar data to the received digest. The avatar digest will be received as part of the &PRESENCE; stanza. Juliet also includes an avatar-digest element with a hex-coded SHA1-digest of the avatar data (i.e. the digest of the image file): </p>
  190. <example caption='Avatar Digest'><![CDATA[
  191. <presence from='juliet@capulet.com/balcony' to='room1@shakespeare.com/WebGirl'
  192. <x xmlns='firebat:user:jid'>juliet@capulet.com/balcony</x>
  193. <x xmlns='firebat:avatar:digest'>9b3635eb1440a1ee1c9f67767651194f34ecf130</x>
  194. </presence>]]>
  195. </example>
  196. <p>Romeo receives the digest with the initial &PRESENCE; stanza from Juliet. Since this is their first meeting Romeo does not have Juliet&apos;s avatar yet. He will fetch the avatar from Juliet&apos;s public XML server storage (for a public XML storage free variant see below):</p>
  197. <example caption='Avatar Request'><![CDATA[
  198. <iq type='get' to='juliet@capulet.com'>
  199. <query xmlns='storage:client:avatar' />
  200. </iq>]]>
  201. </example>
  202. <p>The server returns Juliet&apos;s avatar. </p>
  203. <example caption='Avatar Response with Avatar URL'><![CDATA[
  204. <iq type='result' to='romeo@montague.net/garden'>
  205. <query xmlns='storage:client:avatar'>
  206. <data src='http://www.capulet.com/juliet.png'/>
  207. </query>
  208. </iq>]]>
  209. </example>
  210. <p>The &apos;src&apos; attribute points to the real data, which is to be fetched out of band via HTTP. Juliet supplied a reference to the data because she is a smart WebGirl concerned about bandwidth on the Jabber connection. But if the Capulets would not own a domain she could also choose to store the avatar data directly on the server using base-64 encoding. The avatar response would then be like:</p>
  211. <example caption='Avatar Response with Immediate Data'><![CDATA[
  212. <iq type='result' to='romeo@montague.net/garden'>
  213. <query xmlns='storage:client:avatar'>
  214. <data mimetype='image/png' encoding='base64'
  215. >E00fcB79F822u192e7A2067E5229ec136892A296... </data>
  216. </query>
  217. </iq>]]>
  218. </example>
  219. <p>Juliet can omit the &apos;mimetype&apos; attribute if she supplies the avatar URL, because the HTTP server will return the MIME type. The &apos;mimetype&apos; attribute must be included for immediate data. Avatars may be of any type and size. The maximum visible dimensions of avatars should be 64x96 pixels. Larger images will be scaled down to fit into this rectangle. They will not be scaled up. Images align at the bottom so that they can &apos;stand&apos; on a page on the same base line. </p>
  220. <p>Implementation note: The client should check the image size (byte count) and advice the user if the size exceeds 20 kb. It should also check the image dimensions and warn the user if the image will be scaled down. Checking the size is especially important for immediate data, which will be uploaded over a Jabber connection which is subject to flow control. Typical karma settings only allow for few kb without stalling the connection.</p>
  221. <p>Implementation note: Avatars and associated digests should be stored permanently. They will always be up to date as soon as people meet and exchange digests. There is no cache timeout. The implementation should keep an eye on the avatar storage and delete old and rarely used ones.</p>
  222. <p>Avatars images can also be created of other data types. The following shows an avatar description in XML format, which is to be processed by an advanced avatar engine. The avatar engine will be chosen by the MIME type. For simple image based avatars, the MIME type selects the type of image decoder. Other MIME types may select from a dynamic list of installable avatar rendering plug-ins.</p>
  223. <example caption='Avatar Response for an Advanced Avatar'><![CDATA[
  224. <iq type='result' to='romeo@montague.net/garden'>
  225. <query xmlns='storage:client:avatar'>
  226. <data mimetype='avatar/comic' encoding='plain'>
  227. <config xmlns='http://schema.bluehands.de/character-config' version='1.0'>
  228. <character name='lluna' version='1.0'
  229. src='http://avatar.vp.bluehands.de/comic/lluna.xml'/>
  230. <color rgb='#00FF00' name='head'/>
  231. <color rgb='#999900' name='shadow'/>
  232. <color rgb='#000000' name='border'/>
  233. <color rgb='#FFFFFF' name='tooth'/>
  234. <color rgb='#FFFFFF' name='eye'/>
  235. <color rgb='#000000' name='pupil'/>
  236. <color rgb='#000000' name='mouth'/>
  237. <color rgb='#FF0000' name='tail1'/>
  238. <color rgb='#FF0000' name='tail2'/>
  239. <color rgb='#FF0000' name='tail3'/>
  240. <scale ratio='0.8'/>
  241. </config>
  242. </data>
  243. </query>
  244. </iq>]]>
  245. </example>
  246. <p>The example avatar data above will be interpreted by the avatar engine, which registered for the MIME type &apos;avatar/comic&apos;. This is a sample implementation of an animated avatar. The data states that an animation file shall be loaded from http://avatar.vp.bluehands.de/comic/lluna.xml and then the character config shall be applied modifying the colors of the character definition.</p>
  247. <p>The design is particular targeted at existing online games as avatar providers. It would be very easy to adapt the avatar rendering of an online role playing game (MMORPG) or any other community so that it provides avatar images for the VP client. In this case the avatar data would probably only consist of the online accout ID. This is up to the implementation. We imagine such avatar data to be like:</p>
  248. <example caption='Potential Role Play-Plugin Avatar Data'><![CDATA[
  249. <iq type='result' to='romeo@montague.net/garden'>
  250. <query xmlns='storage:client:avatar'>
  251. <data mimetype='rpg/my-favorite-mmorpg' encoding='plain'>ACCOUNTID=6575438998</data>
  252. </query>
  253. </iq>]]>
  254. </example>
  255. <p>... and the plug-in (which is part or the game distribution) connects to the game server, fetches the configuration, and renders Juliet as an nightelve mage level 30 with all insignia on the web page of Romeo. Romeo is very impressed, falls in love instantly and they both die in the course of a tragic story. Provided that Romeo happens to have the same gaming engine installed. Having not might save him in this time.</p>
  256. <p>Note: As a matter of fact, we propose a call level plug-in interface formerly described at http://developer.lluna.de/docs/animated-avatars.html for advanced avatars.</p>
  257. <p>Note: To make things simple for the implementation users may have 2 avatars. The first avatar (&apos;storage:client:avatar&apos;) is restricted to GIF and PNG images. The second avatar is fully featured, but optional. It is accessed through the namespace &apos;storage:client:avatar2&apos; and tracked through digest &apos;firebat:avatar2:digest&apos;. VP clients must implement &apos;storage:client:avatar&apos; and &apos;firebat:avatar:digest&apos; with at least PNG support. They may implement &apos;storage:client:avatar2&apos; and &apos;firebat:avatar2:digest&apos;. The scheme can be extended with higher numbers. </p>
  258. </section2>
  259. <section2 topic='Other Ways to get the Avatar'>
  260. <p>If Juliet wants to protect her real JID, then she can not use public XML server storage. She can still provide an avatar by including the avatar data into the &PRESENCE; stanza. </p>
  261. <example caption='Explicit Avatar Presence Data'><![CDATA[
  262. <x xmlns='firebat:avatar:data'><data src='http://www.capulet.com/juliet.png'/></x>
  263. as part of:
  264. <presence from='juliet@capulet.com/balcony' to='room1@shakespeare.com/WebGirl'
  265. <x xmlns='firebat:avatar:digest'>9b3635eb1440a1ee1c9f67767651194f34ecf130</x>
  266. <x xmlns='firebat:avatar:data'><data src='http://www.capulet.com/juliet.png'/></x>
  267. </presence>]]>
  268. </example>
  269. <p>Juliet must not send bulky immediate data, but a reference to the image. Immediate data is only allowed, if it is smaller than a simple &PRESENCE; stanza (see above). </p>
  270. <example caption='Explicit and Immediate Avatar Presence Data'><![CDATA[
  271. <x xmlns='firebat:avatar:data'>
  272. <data mimetype='rpg/my-favorite-mmorpg' encoding='plain'>ACCOUNTID=6575438998</data>
  273. </x>]]>
  274. </example>
  275. <p>Note: There are other features which won't work without the real JID. Therefore, it is recommended that clients include the JID in the &PRESENCE; stanza. If Juliet wants to use all JID-based features then she would rather use a public Jabber server with an anonymous account, like she is used to do in case of email. This feature is supported because there are still Juliets who refrain from disclosing the JID and because the avatar is very important.</p>
  276. <p>If Juliet provides the JID, but public XML server storage is not supported on Juliet&apos;s server, then Romeo may try to discover the avatar using disco features. He will query Juliet&apos;s server avatar disco node</p>
  277. <example caption='Avatar Discovery Request'><![CDATA[
  278. <iq to='juliet@capulet.com' type='get'>
  279. <query xmlns='http://jabber.org/protocol/disco#info' node='http://jabber.org/protocol/avatar'/>
  280. </iq>]]>
  281. </example>
  282. <p>The result contains an item with the JID of the pubsub component where Juliet's avatar information is published and the specific node for that information:</p>
  283. <example caption='Avatar Discovery Response'><![CDATA[
  284. <iq type='result' from='juliet@capulet.com' to='romeo@montague.net/orchard' >
  285. <query xmlns='http://jabber.org/protocol/disco#items'
  286. node='http://jabber.org/protocol/avatar'>
  287. <item jid='pubsub.shakespeare.lit' node='avatar/info/juliet@capulet.com'/>
  288. </query>
  289. </iq>]]>
  290. </example>
  291. </section2>
  292. <section2 topic='Avatar Movement'>
  293. <p>A web page can be regarded as a two dimensional space. Avatars can move around on the page. Users are not just at a page, they are at a certain coordinate of the page. Entering the room Juliet tells Romeo (and all other participants) her initial position by including a position element into the initial &PRESENCE; stanza:</p>
  294. <example caption='Avatar Position'><![CDATA[
  295. <presence from='juliet@capulet.com/balcony' to='room1@shakespeare.com/WebGirl'
  296. <x xmlns='firebat:user:jid'>juliet@capulet.com/balcony</x>
  297. <x xmlns='firebat:avatar:digest'>9b3635eb1440a1ee1c9f67767651194f34ecf130</x>
  298. <x xmlns='firebat:avatar:position'><position x='180' w='853'/></x>
  299. </presence>]]>
  300. </example>
  301. <p>The coordinates are in pixels from the bottom left corner of the browser window. In this case she only tells the horizontal position. She could add a &apos;y&apos; attribute. She also voluntarily discloses the width of her browser window. The width (&apos;w&apos;) and height (&apos;h&apos;) attributes are optional. They enable relative positioning at the other end.</p>
  302. <p>As soon as Juliet enters and her avatar appears, Romeo moves his avatar up to Juliet&apos;s. Romeo&apos;s VP client sends a new &PRESENCE; stanza with an altered position. The message is automatically broadcast by the room to all participants and stored for new participants. Romeo approaches Juliet:</p>
  303. <example caption='Move Avatar'><![CDATA[
  304. <presence from='romeo@montague.net/garden' to='room1@shakespeare.com/YoungHero'
  305. <x xmlns='firebat:user:jid'>romeo@montague.net</x>
  306. <x xmlns='firebat:avatar:digest'>e5229ec136892e00fcb79f822c192e7a2067a296</x>
  307. <x xmlns='firebat:avatar:position'><position x='150'/></x>
  308. </presence>]]>
  309. </example>
  310. <p>Note that this &PRESENCE; stanza, which is sent in order to move the avatar is not different from the initial &PRESENCE; stanza to the room. This is just a repetition with a different coordinate.</p>
  311. <p>Juliet&apos;s VP client forwards the movement to the avatar rendering engine. In case of an image based avatar the image is just moved to take up the new position. In case on an animated avatar, the avatar engine will generate a sequence of images which lets the figure &apos;walk&apos; to the new position or whatever movement method is appropriate for the avatar.</p>
  312. <p>Now Romeo occupies exactly the part of the web page that Juliet is reading so she moves Romeo (locally) out of the way. This happens only on Juliet&apos;s screen. Once Juliet finished reading, she wants to restore Romeo&apos;s position. She sends a control message to Romeo to request the current position:</p>
  313. <example caption='Request Avatar Position'><![CDATA[
  314. <iq from='room1@shakespeare.com/WebGirl' to='room1@shakespeare.com/YoungHero' type='get'>
  315. <query xmlns='http://schema.bluehands.de/avatar#position'/>
  316. </iq>]]>
  317. </example>
  318. <p>Romeo responds with a control message which indicates the avatar position:</p>
  319. <example caption='Send Avatar Position'><![CDATA[
  320. <iq from='room1@shakespeare.com/YoungHero' to='room1@shakespeare.com/WebGirl' type='result'>
  321. <query xmlns='http://schema.bluehands.de/avatar#position'>
  322. <position x='123' w='800'/>
  323. </query>
  324. </iq>]]>
  325. </example>
  326. <p>Juliet&apos; VP client restores Romeo&apos;s avatar position:</p>
  327. </section2>
  328. <section2 topic='Bubble Chat'>
  329. <p>We remember: after seeing Juliet&apos;s avatar, Romeo has already falling in love. But Juliet is a more realistic type. She insists on talking before falling in love. The avatar-on-web-pages paradigm frees us from chat line based chat. Each avatar may show a separate chat bubble with the latest text or even a chat history. </p>
  330. <p>While Juliet is writing an opening, her VP client may send the current contents of the chat line to the room giving other participants snapshots of the text. We propose instant chat updates as an extension to groupchat. For backward compatibility these snapshots are transmitted as control messages without body text, so that other clients ignore them. Once Juliet hits the send button (or the enter-key) the VP client sends the chat message as body text of a &MESSAGE;. With a timely distance of fractions of seconds to few seconds Juliet sends the following messages:</p>
  331. <example caption='Instant Chat'><![CDATA[
  332. <message from='room1@shakespeare.com/WebGirl' to='room1@shakespeare.com'>
  333. <x xmlns='firebat:chat:state'>Who</x>
  334. </message>
  335. <message from='room1@shakespeare.com/WebGirl' to='room1@shakespeare.com'>
  336. <x xmlns='firebat:chat:state'>Who art thou,</x>
  337. </message>
  338. <message from='room1@shakespeare.com/WebGirl' to='room1@shakespeare.com'>
  339. <x xmlns='firebat:chat:state'>Who art thou, YoungHer</x>
  340. </message>
  341. <message from='room1@shakespeare.com/WebGirl' to='room1@shakespeare.com'>
  342. <body>Who art thou, YoungHero?</body>
  343. </message>]]>
  344. </example>
  345. <p>Note: we propose to send the full text with every message. Differential updates seem to be the proper way. But the addressing information sent with each message produces more traffic than the enclosed text. This is especially true for randomly chosen (read: long) room names. On the other hand differential text requires synchronization points for new participants, who lack the history. Such synchronization points would carry the full text every other second rendering differential updates almost useless.</p>
  346. <p>Implementation note: The traffic must stay below the karma-limitations of typical jabber servers. The minimum delay between instant chat messages should be 1 sec. The delay should be increased with the size of the text. We get a good balance between interactivity and traffic with the following algorithm (in msec): delay = max(5000, min(NumberOfChars x 25, 1000)). In words: from 1 second at 40 characters up to 5 seconds at 200 characters.</p>
  347. <p>Implementation note: There is no limitation on the size of the instant chat specified. But some users, especially the ones not used to chat channels write without ever pressing the enter-key. Implementations should limit the size to reasonable length (200-1000 characters) by telling the user, refusing to send more, or just stripping the beginning of a long text.</p>
  348. </section2>
  349. <section2 topic='Video Icon'>
  350. <p>After some chatting, Juliet is still not convinced. She demands to see Romeo live (although not in person). Romeo switches on his webcam and sends the webcam URL as part of the &PRESENCE; stanza.</p>
  351. <example caption='Iconic Video'><![CDATA[
  352. <presence from='romeo@montague.net/garden' to='room1@shakespeare.com/YoungHero'
  353. <x xmlns='firebat:user:jid'>romeo@montague.net</x>
  354. <x xmlns='firebat:avatar:digest'>e5229ec136892e00fcb79f822c192e7a2067a296</x>
  355. <x xmlns='firebat:avatar:position'><position x='150'/></x>
  356. <x xmlns='firebat:icon:video'>http://romeo.montague.net/video/icon</x>
  357. </presence>]]>
  358. </example>
  359. <p>Juliet&apos;s VP client HTTP-requests the video stream. The video is shown close to Romeo&apos;s avatar. Juliet falls in love.</p>
  360. <p>The video format is the common, widely used webcam format introduced by Netscape (JPEG server-pushed).</p>
  361. <p>In the real world there are many Romeos and Juliets even on the same page at the same time. Some of them with a webcam. Depending on the default settings of VP clients all users (say 8) will automatically request the videos of the subset of users equipped with a webcam (say 3). This automatically creates many video streams, 3 streams on the dialup line of all users and 7 streams on the line of webcam users. We therefore suggest the following optimizations and limitations:</p>
  362. <ul>
  363. <li>video dimensions should be limited to 64x64 pixels, thus fitting into the 64x96 avatar rectangle,</li>
  364. <li>the frame rate should not exceed 3 frames per second for simple web browsing (special applications, especially assymmetric ones, like virtual class rooms, presentations may differ),</li>
  365. <li>for small sizes, quantization tables and Huffman tables make much more data than the encoded image. Therefore, the DQT and DHT markers should be stripped from JPEG frames except for the first frame of a stream. Only the JPEG baseline algorithm is supported with static Huffman tables,</li>
  366. <li>VP clients which support such a optimized JPEG server-push format should add a &apos;Accept: image/djpeg&apos; header to the HTTP request. (djpeg for differential JPEG)</li>
  367. </ul>
  368. <p>The purpose of these limitations is to allow for webcams which send optimized streams of small images (reducing the data volume by a factor of 3) while supporting usual webcams.</p>
  369. </section2>
  370. </section1>
  371. <section1 topic='Finding Virtual Locations'>
  372. <p>Finding a virtual location for a websites means mapping a URL to a JID. The VP client gets the URL from the browser by some platform dependent way of interprocess communication. The URL may have been entered by the user, or it may be the result of a URI resolver. Then the VP client searches for an applicable mapping rule. This may include fetching multiple configuration files over the network. Finally the rule is applied and the VP client can enter the room.</p>
  373. <p>The mapping process is explained in great detail here. Server admins only need the sections &apos;Mapping Rules&apos; and &apos;Config Files&apos;</p>
  374. <section2 topic='Mapping Rules'>
  375. <p>The basic mechanism is very simple: a URL is mapped by means of a regular expression with replacement term. A hash function may follow after the regular expression and an optional prefix can be added for convenience. The mapping rule produces a room name and a chat service URL. The chat service URL points to the server which hosts the channel. It also tells which protocol to use. Protocol, server address and channel name identify the chat channel.</p>
  376. <p>Romeo is on http://www.shakespeare.com/market/ModernLibrary/index.html. A single mapping rule might cover the entire URL space of http://www.shakespeare.com/. It might look like:</p>
  377. <example caption='Basic Mapping Rule'><![CDATA[
  378. <location match='^http://www\.shakespeare\.com/([^/]+)/.*$'>
  379. <name>\1-room</name>
  380. <digest><prefix>vp-</prefix></digest>
  381. <service>xmpp:conference.shakespeare.com</service>
  382. </location>]]>
  383. </example>
  384. <example caption='Basic Mapping Rule Result: a Room JID'><![CDATA[
  385. vp-85b0df53e7ce7d2e0406d2bbf8a9d699aaa9db53@conference.shakespeare.com]]>
  386. </example>
  387. <p>This &lt;name/&gt;-tag produces the room name. The text of the &lt;name/&gt;-tag in combination with the match expression of the &lt;location/&gt; extracts the first level folder of the path section from the URL. It creates a room for each first level folder. The resulting room name is &apos;market-room&apos;. It is hashed by a message digest, if the &lt;digest/&gt; tag is present. A SHA1 digest is used by default. VP clients must support SHA1. The hashed result will be prefixed by &apos;vp-&apos;. Prefixing is provided for convenience, so that rooms generated for virtual presence can be sorted easily in room lists of conference components. Both &lt;digest/&gt; and &lt;prefix/&gt; are optional.</p>
  388. <p>The \1 variable of the match-expression is used to generate a room per sub-folder of the URL. Match-expression variables can be used inside all elements to modify the inner text of the element. You might use the \1 inside the &lt;service/&gt;-tag to point to a different chat server per sub-folder of the URL.</p>
  389. <p>The rule generates a virtual location ID. This mechanism is extensible to other protocols as virtual presence transport, e.g. IRC. The &lt;service/&gt;-tag contains a service URL, which consists of a scheme and server address. In this case the &apos;xmpp&apos;-scheme means that the Jabber protocol will be used and that the VP client joins a Jabber chat room with a JID created according to the Jabber ID building rules, i.e. room-name@server-address, where the room-name has been derived from the &apos;name&apos;-tag and mangled by the &apos;digest&apos;-tag before it has been prepended to '@server-address'.</p>
  390. <p>A &lt;location/&gt; without match-attribute matches all URLs. In other words: the default match-attribute is '.*'.</p>
  391. </section2>
  392. <section2 topic='Config Files'>
  393. <p>Rules can be stored in various ways. If they are stored in files, then the rules are wrapped by a toplevel element. The VPI toplevel element can contain multiple &lt;location/&gt;-elements (rules):</p>
  394. <example caption='VPI file format'><![CDATA[
  395. <?xml version='1.0' ?>
  396. <vpi xmlns='http://schema.bluehands.de/virtual-presence-info'>
  397. <location match='...'>...</location>
  398. <location match='...'>...</location>
  399. ... <!-- more locations -->
  400. <location>...</location> <!-- default location -->
  401. </vpi>]]></example>
  402. <p>Examples were formerly available at http://developer.lluna.de/docs/vpi-file-syntax.html</p>
  403. </section2>
  404. <section2 topic='Extensions to Mapping Rules'>
  405. <p>Independent services may publish lists of virtual locations. An example is a &apos;topsites&apos;-service, which publishes a list of most active locations as a list of URLs. These services usually require the cooperation of VP clients. VP clients publish their locations (and URLs), if configured to do so. In some cases website operators allow for virtual presence on their pages, but they do not want that the real URLs are published, or they do not want the URLs published at all. Therefore, the location configuration offers optional tags to control how URLs are disclosed by VP clients. A &lt;hidden/&gt;-tag prohibits the publication of the URL. A &lt;destination/&gt;-tag modifies the URL. A &lt;hidden/&gt; location may look like:</p>
  406. <example caption='Hidden Location'><![CDATA[
  407. <location match='^http://www\.shakespeare\.com'>
  408. <name>shakespeare</name>
  409. <digest/>
  410. <service>xmpp:conference.shakespeare.com</service>
  411. <hidden/>
  412. </location>]]>
  413. </example>
  414. <p>In this example all URLs of the website will be mapped to a single room. Users will be present there, but the room will not appear in public lists (if clients and publication services comply).</p>
  415. <p>A simplification of the above is the &lt;mapped/&gt;-tag, which does not employ regular expressions. All URLs of the website can be mapped to a single location (omitting the &lt;hidden/&gt; feature again):</p>
  416. <p>The &lt;destination/&gt;-tag modifies the URL so that website operators control which URLs are published. They might delete a web-session ID from URLs or alter the URL so that users who discover the location on a publication service are directed to a different URL. The biggest concern is that the exposed URL may contain security relevant session data. The &lt;destination/&gt;- (per &lt;rule/&gt;) allows to remove this data from URLs while preserving browseable URLs. The following example deletes any path and query from URLs.</p>
  417. <example caption='Destination: Modifying Published URLs'><![CDATA[
  418. <location match='^http://www\.shakespeare\.com'>
  419. <name>shakespeare</name>
  420. <digest/>
  421. <service>xmpp:conference.shakespeare.com</service>
  422. <destination>http://www.shakespeare.com/</destination>
  423. </location>]]>
  424. </example>
  425. <p>Note: VP clients should not rely on a &lt;destination/&gt; only, when publishing URLs. A client should consult the user if, how, and where URLs are to be published. It is recommended to strip the query part by default until configured otherwise. </p>
  426. <p>The &lt;ignore/&gt;-tag prevents virtual presence clients from dealing with matching URLs. There will be no virtual presence associated with the URL.</p>
  427. <example caption='Ignore: Opt out'><![CDATA[
  428. <location match="^http://www\.shakespeare\.com($|/.*$)">
  429. <ignore/>
  430. </location>]]>
  431. </example>
  432. </section2>
  433. <section2 topic='Web Server based Configuration'>
  434. <p>Location configuration data, such as the above is stored in configuration files called Virtual Presence Information (VPI) files. The files are fetched via HTTP or FTP, according to the scheme of the URL which is to be mapped. Websites can offer VPI files at each level in the path hierarchy. If they do not offer VPI files then the VP client reverts to default VPI. The VP client tries to find a VPI file in the same folder as the file of the URL. It strips the file and query parts of the URL and appends the file name _vpi.xml:</p>
  435. <example caption='Nearest VPI File'><![CDATA[
  436. http://www.shakespeare.com/market/ModernLibrary/_vpi.xml]]>
  437. </example>
  438. <p>HTTP-servers have many different ways to respond if the file is not available, which is the most common case. They should respond with a 404 status code and an optional HTML message. But some web servers are configured to return a default document, some return a status code 200 and a &apos;Content-type: text/html&apos; message with an error text, some even return status code 200 and &apos;Content-type: text/xml&apos; with an HTML message. It is therefore recommended that VP clients check the HTTP status code, the Content-type and the validity of the XML document. If there is no such file or if it is not a valid XML file or, in case of HTTP, if the Content-type is not text/xml, then the request fails. If the request fails then the client ascends the path until it hits the top level of the website trying to fetch:</p>
  439. <example caption='Web Site Toplevel VPI File'><![CDATA[
  440. http://www.shakespeare.com/_vpi.xml]]>
  441. </example>
  442. <p>If the request fails, then the client reverts to a default VPI file if there is any. The current implementation uses http://vpi.vp.bluehands.de/lluna-2.5.2/root-vpi.xml. It will finally use http://www.virtual-presence.org/LMS/root-vpi.xml (LMS = Location Mapping System) or another global configuration file. http://vp.jabber.org/root.xml would be an option.</p>
  443. <p>If there is no default VPI file then the VP client uses the following configuration data:</p>
  444. <code caption='Default VPI'><![CDATA[
  445. <location>
  446. <name>\1</name>
  447. <digest/>
  448. <service>xmpp:location.virtual-presence.org</service>
  449. </location>]]>
  450. </code>
  451. <p>This configuration creates a virtual location for each web server address. The server name is obfuscated by a hash function (SHA1). The location configuration applies to all URLs, since the match-attribute of the &lt;location/&gt; defaults to &apos;.*&apos;.</p>
  452. <p>VP clients must cache the result of VPI downloads including failed requests and invalid responses. They must keep a local copy for at least a few minutes to avoid traffic from multiple (ascending) VPI file downloads. </p>
  453. <p>Note: There are many websites, which consist of multiple web server addresses. This is especially true for large sites, which use DNS round-robin for load balancing. These websites need a special mapping to meet the expectation of the user, because users usually do not care if they are on www01.website.com or on www02.website.com. If users expect to see each other, then the virtual presence service should meet the expectations. There might also be website operators, who do not like virtual presence on their pages. These operators may even take legal action against the provider of the VP client software. So, these websites may require special configuration as well. And there may be other reasons for individual configuration of selected websites. Therefore, it is recommended, that VP clients update their default configuration, i.e. by using an automatic update feature or by downloading the default VPI.</p>
  454. <p>A VPI file may delegate the handling of URL spaces to another VPI file. The &lt;delegate/&gt;-node replaces the &lt;mapping/&gt; and &lt;service/&gt; nodes of the &lt;location/&gt;. If the VP client discovers a &lt;delegate/&gt; tag inside a &lt;location/&gt;, which matches the URL to be mapped, then it stops processing the file and loads the VPI file denoted by the &lt;delegate/&gt;-tag. A request to http://www.shakespeare.com/market/ModernLibrary/_vpi.xml could return VPI like:</p>
  455. <example caption='Delegation'><![CDATA[
  456. <location>
  457. <delegate>http://www.shakespeare.com/_vpi.xml</delegate>
  458. </location>]]>
  459. </example>
  460. <p>This means that the VP client skips http://www.shakespeare.com/market/_vpi.xml and continues with http://www.shakespeare.com/_vpi.xml. Delegation can be used to direct the VP client to the VPI file of a commercial virtual presence service. The commercial service would then be responsible to create rooms for customers and to provide the appropriate VPI. Delegation is also useful to split up the default VPI file. The default VPI file contains special configuration for some large websites. It has been split into individual files for different (DNS) top level domains. The global VPI file currently in use (http://vpi.vp.bluehands.de/lluna-2.5.2/root-vpi.xml) contains the following statement for the .com space:</p>
  461. <example caption='Delegation for Subspaces'><![CDATA[
  462. ...
  463. <location match="^http://.*\.com($|/.*)">
  464. <delegate>http://vpi.vp.bluehands.de/lluna-2.5.2/dotcom-vpi.xml</delegate>
  465. </location>]]>
  466. ...
  467. </example>
  468. </section2>
  469. <section2 topic='The Mapping Process'>
  470. <p>This section is intended as a guideline for the implementation of the mapping process.</p>
  471. <p>The mapping has 2 phases:</p>
  472. <ol>
  473. <li>finding the rule</li>
  474. <li>applying the rule</li>
  475. </ol>
  476. <section3 topic='Find the Rule'>
  477. <p>We get a URL from the web browser, say:</p>
  478. <code><![CDATA[http://www.shakespeare.com/market/ModernLibrary/index.html]]></code>
  479. <p>We try to fetch the configuration file from</p>
  480. <code><![CDATA[http://www.shakespeare.com/market/ModernLibrary/_vpi.xml]]></code>
  481. <p>The request fails (the failure is noted in the cache), and we try</p>
  482. <code><![CDATA[http://www.shakespeare.com/market/_vpi.xml]]></code>
  483. <p>The request fails again (the failure is noted in the cache). We try</p>
  484. <code><![CDATA[http://www.shakespeare.com/_vpi.xml]]></code>
  485. <p>
  486. We do not find it (the failure is noted in the cache), and we revert to
  487. the global file (which one depends on the client configuration)
  488. </p>
  489. <code><![CDATA[http://vpi.vp.bluehands.de/lluna-2.5.2/root-vpi.xml]]></code>
  490. <p>The request returns (and the data is stored in the cache):</p>
  491. <code><![CDATA[
  492. <?xml version='1.0' ?>
  493. <vpi xmlns='http://schema.bluehands.de/virtual-presence-info'>
  494. <!-- handle .com(s) by another file -->
  495. <location match='^http://.*\.com/.*'>
  496. <delegate>http://vpi.vp.bluehands.de/lluna-2.5.2/dotcom-vpi.xml</delegate>
  497. </location>
  498. <!-- handle .de(s) by another file -->
  499. <location match='^http://.*\.de/.*'>
  500. <delegate>http://vpi.vp.bluehands.de/lluna-2.5.2/dotde-vpi.xml</delegate>
  501. </location>
  502. <!-- all others go here -->
  503. <location match='^http://([^/]+)($|/.*$)'>
  504. <service>xmpp:location.virtual-presence.org</service>
  505. <!-- one location per website -->
  506. <name>\1</name>
  507. <digest/>
  508. </location>
  509. </vpi>]]></code>
  510. <p>We try to find a &lt;location/&gt; that matches our URL. We find:</p>
  511. <code><![CDATA[
  512. <location match='^http://.*\.com/.*'>
  513. <delegate>http://vpi.vp.bluehands.de/lluna-2.5.2/dotcom-vpi.xml</delegate>
  514. </location>]]></code>
  515. <p>
  516. This means that all .com domains are forwarded to a separate VPI file.
  517. We fetch:
  518. </p>
  519. <code><![CDATA[http://vpi.vp.bluehands.de/lluna-2.5.2/dotcom-vpi.xml]]></code>
  520. <p>
  521. We store the result in the cache and search for a matching
  522. &lt;location/&gt; again.
  523. We find the default section (rest of the file omitted, the match-attribute
  524. is more general than the one of the previous &lt;delegate/&gt;, because
  525. here we are already in the .com domain):
  526. </p>
  527. <code><![CDATA[
  528. ...
  529. <location match='^http://([^/]+)($|/.*$)'>
  530. <service>xmpp:location.virtual-presence.org</service>
  531. <mapping>
  532. <name>\1</name>
  533. <digest/>
  534. </location>
  535. ...]]></code>
  536. <p>
  537. The &lt;location/&gt; matches, so we get a virtual presence service
  538. address and a set of rules.
  539. The virtual presence server is
  540. </p>
  541. <code><![CDATA[location.virtual-presence.org]]></code>
  542. <p>The protocol to use is</p>
  543. <code><![CDATA[xmpp]]></code>
  544. <p>There mapping rule is:</p>
  545. <code><![CDATA[
  546. match='^http://([^/]+)($|/.*$)'
  547. <name>\1</name>
  548. <digest/>]]></code>
  549. <p>
  550. The result of the first phase is a mapping rule, which will be applied to
  551. all URLs <em>in the same folder</em> as the original URL.
  552. In regex-speech:
  553. </p>
  554. <code><![CDATA[http://www.shakespeare.com/market/ModernLibrary/.*]]></code>
  555. <p>
  556. To apply the mask only to URLs in the same URL-path folder is a security
  557. requirement, so that &apos;inner&apos; VPI files from websites can not
  558. configure the mapping of &apos;outer&apos; folders or
  559. &apos;siblings&apos;.
  560. </p>
  561. <p>The original URL was:</p>
  562. <code><![CDATA[http://www.shakespeare.com/market/ModernLibrary/index.html]]></code>
  563. <p>
  564. So, the security mask is (the rule applies only to URLs in the same folder
  565. as the original URL):
  566. </p>
  567. <code><![CDATA[^http://www\.shakespeare\.com/market/ModernLibrary/.*]]></code>
  568. <p>
  569. If the security mask applies to a URL can be verified by a simple
  570. string-compare without using a regular expression.
  571. </p>
  572. <p>
  573. The &lt;location/&gt; has a match attribute.
  574. This is the user supplied mask of the rule:
  575. </p>
  576. <code><![CDATA[^http://([^/]+)($|/.*$)]]></code>
  577. </section3>
  578. <section3 topic='Apply the Rule'>
  579. <p>The URL where we want to meet people is:</p>
  580. <code><![CDATA[http://www.shakespeare.com/market/ModernLibrary/index.html]]></code>
  581. <p>
  582. We got many rules with a security mask (from the folder of the original
  583. URL) and a regular expression (from the match-attribute).
  584. For each new URl we check the URL against the security mask and the
  585. regular expression.
  586. One of the rules applies to the URL:
  587. </p>
  588. <code><![CDATA[^http://www\.shakespeare\.com/market/ModernLibrary/.*
  589. ^http://([^/]+)($|/.*$)]]></code>
  590. <p>The regular expression</p>
  591. <code><![CDATA[^http://([^/]+)($|/.*$)]]></code>
  592. <p>and the room &lt;name&gt;</p>
  593. <code><![CDATA[\1-room]]></code>
  594. <p>will extract the first level folder from the URL. The URL</p>
  595. <code><![CDATA[http://www.shakespeare.com/market/ModernLibrary/index.html]]></code>
  596. <p>gives:</p>
  597. <code><![CDATA[market-room]]></code>
  598. <p>
  599. The &lt;digest/&gt;-tag tells us to hash the regex replacement result with
  600. the default message digest SHA1. So we get:
  601. </p>
  602. <code><![CDATA[87d0c3e8d08f344375f22014c7cafe6527acbae3]]></code>
  603. <p>The &lt;prefix/&gt;-tag tells us to prefix with</p>
  604. <code><![CDATA[vp-]]></code>
  605. <p>and finally the ID of the virtual location (the room name) is:</p>
  606. <code><![CDATA[vp-87d0c3e8d08f344375f22014c7cafe6527acbae3]]></code>
  607. <p>From the &lt;service/&gt;</p>
  608. <code><![CDATA[xmpp:location.virtual-presence.org]]></code>
  609. <p>
  610. the client knows the transport protocol and the address. The Jabber
  611. protocol will be used as transport protocol and the Jabber conference room
  612. JID is
  613. </p>
  614. <code><![CDATA[vp-87d0c3e8d08f344375f22014c7cafe6527acbae3@location.virtual-presence.org]]></code>
  615. </section3>
  616. </section2>
  617. </section1>
  618. <section1 topic='Error Codes'>
  619. <p>This document does not introduce new error codes.</p>
  620. </section1>
  621. <section1 topic='Security Considerations'>
  622. <p>The system has been designed to protect the privacy of the user as good as possible. If users decide to run the VP client, then other users may see their movement, but only if they enter the same locations. There is no way to track users, especially since the JIDs of virtual locations (Jabber chat rooms) are supposed to be SHA1 digests of URLs which are not predicable. So people trying to track Romeo have to guess the URL and enter the respective chat room to find Romeo. They cannot browse the room list of a conference component and deduce the URL from the room name.</p>
  623. <p>The fact that clients may disclose their JID in order to provide access to their avatar server storage and in order to enable caching is a weak point. A different but equally unique ID could be for caching purposes, provided that it is part of the &PRESENCE; stanza. But traffic restrictions on the client connection prevent that additional data is exchanged between peers in a room. The data could be broadcast to the room, but this could end up in many people always broadcasting avatars while entering a room (web page). The chosen solution is to let peers download from public server storage. A better solution might be to let the conference component fetch from the server storage. In this case clients would need only the room-JID of the user, not the real JID.</p>
  624. </section1>
  625. <section1 topic='XMPP Registrar Considerations'>
  626. <p>
  627. These namespaces need to be reviewed and/or registered with the XMPP
  628. Registrar as a result of this document:
  629. </p>
  630. <ul>
  631. <li>firebat:user:jid</li>
  632. <li>firebat:avatar:position</li>
  633. <li>firebat:avatar:getpos</li>
  634. <li>firebat:chat:state</li>
  635. <li>firebat:icon:video</li>
  636. <li>firebat:avatar:digest</li>
  637. <li>firebat:avatar2:digest</li>
  638. <li>storage:client:avatar</li>
  639. <li>storage:client:avatar2</li>
  640. </ul>
  641. </section1>
  642. <section1 topic='Formal Definition'>
  643. <section2 topic='Schema'>
  644. <p>No schema definitions yet. They will be added in the next version of this document, if it is considered for publication. </p>
  645. </section2>
  646. </section1>
  647. <section1 topic='Conclusion'>
  648. <p>The virtual presence on Jabber has been designed to fit easily into the existing Jabber infrastructure including existing software components, clients, and protocols. It turns out that Jabber offers everything necessary for basic virtual presence. </p>
  649. <p>
  650. This document proposes a mapping process in order to create a space for
  651. virtual presence on top of the URL based Web infrastructure.
  652. It also proposes namespace extensions for the protocol, which make virtual
  653. presence on web pages more convenient.
  654. The core features are:
  655. </p>
  656. <ul>
  657. <li>URL mapping and service discovery,</li>
  658. <li>avatars standing and walking on a web page,</li>
  659. <li>bubble chat,</li>
  660. <li>iconic video.</li>
  661. </ul>
  662. <p>There are definitely more features possible. Suggestions are welcome</p>
  663. </section1>
  664. </xep>