Commit dc708e70 authored by JC Brand's avatar JC Brand

Update docs.

- Add link to Movim's page on BOSH servers
- Update the text around prebinding a bit.
parent 8cd05206
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 619e5f84e981950155ae238c5fc1fbf2 config: 652c197d955de4d2c90bb99dc6534a15
tags: fbb0d17656682115ca4d033fb2f83ba1 tags: fbb0d17656682115ca4d033fb2f83ba1
...@@ -211,21 +211,26 @@ Pre-binding and Single Session Support ...@@ -211,21 +211,26 @@ Pre-binding and Single Session Support
It's possible to enable single-site login, whereby users already It's possible to enable single-site login, whereby users already
authenticated in your website will also automatically be logged in on the chat server, authenticated in your website will also automatically be logged in on the chat server,
but this will require custom code on your server.
Jack Moffitt has a great `blogpost`_ about this and even provides an `example Django application`_ to demonstrate it. To do this you will require a `BOSH server <http://xmpp.org/about-xmpp/technology-overview/bosh/>`_
for converse.js to connect to (see the `bosh_service_url`_ under `Configuration variables`_)
as well as a BOSH client on your own server that will do the pre-authentication before the web page
loads.
.. Note :: .. note::
If you want to enable single session support, make sure to pass **prebind: true** A BOSH server acts as a bridge between HTTP, the protocol of the web, and
when you call **converse.initialize** (see ./index.html). XMPP, the instant messaging protocol.
Additionally you need to pass in valid **jid**, **sid**, **rid** and Converse.js can only communicate via HTTP, but we need to communicate with
**bosh_service_url** values. an XMPP server in order to chat. So the BOSH server acts as a middle man,
translating our HTTP requests into XMPP stanzas and vice versa.
When you authenticate to the XMPP server on your backend, you'll receive two Jack Moffitt has a great `blogpost`_ about this and even provides an `example Django application`_ to demonstrate it.
tokens, RID (request ID) and SID (session ID).
When you authenticate to the XMPP server on your backend application (for
example a BOSH client in Django), you'll receive two tokens, RID (request ID) and SID (session ID).
These tokens then need to be passed back to the javascript running in your These tokens then need to be passed back to converse.js running in your
browser, where you will need them to attach to the existing session. browser, where you they will be used to attach to the existing session.
You can embed the RID and SID tokens in your HTML markup or you can do an You can embed the RID and SID tokens in your HTML markup or you can do an
XMLHttpRequest call to your server and ask it to return them for you. XMLHttpRequest call to your server and ask it to return them for you.
...@@ -247,9 +252,25 @@ relative URL **/prebind** and it expects to receive JSON data back. ...@@ -247,9 +252,25 @@ relative URL **/prebind** and it expects to receive JSON data back.
**Here's what's happening:** **Here's what's happening:**
The JSON data contains the user's JID (jabber ID), RID, SID and the URL to the The JSON data returned from the Ajax call to example.com/prebind contains the user's JID (jabber ID), RID, SID and the URL to the
BOSH connection manager. BOSH server (also called a *connection manager*).
These values are then passed to converse.js's ``initialize`` method.
.. note::
If you want to enable single session support, you need to set **prebind: true**
when calling **converse.initialize** (see ./index.html).
Additionally you need to pass in valid **jid**, **sid**, **rid** and
**bosh_service_url** values.
Setting up a BOSH server
------------------------
The `Movim <http://movim.eu/>`_ project wiki has a very thorough page on setting up a BOSH server for
a wide variety of standalone or XMPP servers.
http://wiki.movim.eu/manual:bosh_servers
Facebook integration Facebook integration
==================== ====================
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; Converse.js 0.6.6 documentation</title> <title>Index &mdash; Converse.js 0.7.1 documentation</title>
<link rel="stylesheet" href="_static/stylesheet.css" type="text/css" /> <link rel="stylesheet" href="_static/stylesheet.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.6.6', VERSION: '0.7.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Converse.js 0.6.6 documentation" href="index.html" /> <link rel="top" title="Converse.js 0.7.1 documentation" href="index.html" />
</head> </head>
<body> <body>
<div id="header_wrap" class="outer"> <div id="header_wrap" class="outer">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="#" title="General Index" <a href="#" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li><a href="index.html">Converse.js 0.6.6 documentation</a> &raquo;</li> <li><a href="index.html">Converse.js 0.7.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<section id="main_content" class="inner"> <section id="main_content" class="inner">
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="#" title="General Index" <a href="#" title="General Index"
>index</a></li> >index</a></li>
<li><a href="index.html">Converse.js 0.6.6 documentation</a> &raquo;</li> <li><a href="index.html">Converse.js 0.7.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
</div> </div>
......
This diff is collapsed.
# Sphinx inventory version 2 # Sphinx inventory version 2
# Project: Converse.js # Project: Converse.js
# Version: 0.6.6 # Version: 0.7.1
# The remainder of this file is compressed using zlib. # The remainder of this file is compressed using zlib.
xm xm
{"]; {"];
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; Converse.js 0.6.6 documentation</title> <title>Search &mdash; Converse.js 0.7.1 documentation</title>
<link rel="stylesheet" href="_static/stylesheet.css" type="text/css" /> <link rel="stylesheet" href="_static/stylesheet.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '0.6.6', VERSION: '0.7.1',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script> <script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="top" title="Converse.js 0.6.6 documentation" href="index.html" /> <link rel="top" title="Converse.js 0.7.1 documentation" href="index.html" />
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); }); jQuery(function() { Search.loadIndex("searchindex.js"); });
</script> </script>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li><a href="index.html">Converse.js 0.6.6 documentation</a> &raquo;</li> <li><a href="index.html">Converse.js 0.7.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<section id="main_content" class="inner"> <section id="main_content" class="inner">
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li><a href="index.html">Converse.js 0.6.6 documentation</a> &raquo;</li> <li><a href="index.html">Converse.js 0.7.1 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
</div> </div>
......
This diff is collapsed.
...@@ -211,21 +211,26 @@ Pre-binding and Single Session Support ...@@ -211,21 +211,26 @@ Pre-binding and Single Session Support
It's possible to enable single-site login, whereby users already It's possible to enable single-site login, whereby users already
authenticated in your website will also automatically be logged in on the chat server, authenticated in your website will also automatically be logged in on the chat server,
but this will require custom code on your server.
Jack Moffitt has a great `blogpost`_ about this and even provides an `example Django application`_ to demonstrate it. To do this you will require a `BOSH server <http://xmpp.org/about-xmpp/technology-overview/bosh/>`_
for converse.js to connect to (see the `bosh_service_url`_ under `Configuration variables`_)
as well as a BOSH client on your own server that will do the pre-authentication before the web page
loads.
.. Note :: .. note::
If you want to enable single session support, make sure to pass **prebind: true** A BOSH server acts as a bridge between HTTP, the protocol of the web, and
when you call **converse.initialize** (see ./index.html). XMPP, the instant messaging protocol.
Additionally you need to pass in valid **jid**, **sid**, **rid** and Converse.js can only communicate via HTTP, but we need to communicate with
**bosh_service_url** values. an XMPP server in order to chat. So the BOSH server acts as a middle man,
translating our HTTP requests into XMPP stanzas and vice versa.
When you authenticate to the XMPP server on your backend, you'll receive two Jack Moffitt has a great `blogpost`_ about this and even provides an `example Django application`_ to demonstrate it.
tokens, RID (request ID) and SID (session ID).
When you authenticate to the XMPP server on your backend application (for
example a BOSH client in Django), you'll receive two tokens, RID (request ID) and SID (session ID).
These tokens then need to be passed back to the javascript running in your These tokens then need to be passed back to converse.js running in your
browser, where you will need them to attach to the existing session. browser, where you they will be used to attach to the existing session.
You can embed the RID and SID tokens in your HTML markup or you can do an You can embed the RID and SID tokens in your HTML markup or you can do an
XMLHttpRequest call to your server and ask it to return them for you. XMLHttpRequest call to your server and ask it to return them for you.
...@@ -247,9 +252,25 @@ relative URL **/prebind** and it expects to receive JSON data back. ...@@ -247,9 +252,25 @@ relative URL **/prebind** and it expects to receive JSON data back.
**Here's what's happening:** **Here's what's happening:**
The JSON data contains the user's JID (jabber ID), RID, SID and the URL to the The JSON data returned from the Ajax call to example.com/prebind contains the user's JID (jabber ID), RID, SID and the URL to the
BOSH connection manager. BOSH server (also called a *connection manager*).
These values are then passed to converse.js's ``initialize`` method.
.. note::
If you want to enable single session support, you need to set **prebind: true**
when calling **converse.initialize** (see ./index.html).
Additionally you need to pass in valid **jid**, **sid**, **rid** and
**bosh_service_url** values.
Setting up a BOSH server
------------------------
The `Movim <http://movim.eu/>`_ project wiki has a very thorough page on setting up a BOSH server for
a wide variety of standalone or XMPP servers.
http://wiki.movim.eu/manual:bosh_servers
Facebook integration Facebook integration
==================== ====================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment