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
# 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
......@@ -211,21 +211,26 @@ Pre-binding and Single Session Support
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,
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 ::
If you want to enable single session support, make sure to pass **prebind: true**
when you call **converse.initialize** (see ./index.html).
Additionally you need to pass in valid **jid**, **sid**, **rid** and
**bosh_service_url** values.
.. note::
A BOSH server acts as a bridge between HTTP, the protocol of the web, and
XMPP, the instant messaging protocol.
Converse.js can only communicate via HTTP, but we need to communicate with
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
tokens, RID (request ID) and SID (session ID).
Jack Moffitt has a great `blogpost`_ about this and even provides an `example Django application`_ to demonstrate it.
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
browser, where you will need them to attach to the existing session.
These tokens then need to be passed back to converse.js running in your
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
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.
**Here's what's happening:**
The JSON data contains the user's JID (jabber ID), RID, SID and the URL to the
BOSH connection manager.
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 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
====================
......
......@@ -9,7 +9,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -17,7 +17,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.6.6',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -26,7 +26,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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>
<body>
<div id="header_wrap" class="outer">
......@@ -51,7 +51,7 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
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>
</div>
<section id="main_content" class="inner">
......@@ -80,7 +80,7 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
>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>
</div>
</div>
......
This diff is collapsed.
# Sphinx inventory version 2
# Project: Converse.js
# Version: 0.6.6
# Version: 0.7.1
# The remainder of this file is compressed using zlib.
xm
{"];
......
......@@ -7,7 +7,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.6.6',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.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">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
......@@ -55,7 +55,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
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>
</div>
<section id="main_content" class="inner">
......@@ -100,7 +100,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>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>
</div>
</div>
......
This diff is collapsed.
......@@ -211,21 +211,26 @@ Pre-binding and Single Session Support
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,
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 ::
If you want to enable single session support, make sure to pass **prebind: true**
when you call **converse.initialize** (see ./index.html).
Additionally you need to pass in valid **jid**, **sid**, **rid** and
**bosh_service_url** values.
.. note::
A BOSH server acts as a bridge between HTTP, the protocol of the web, and
XMPP, the instant messaging protocol.
Converse.js can only communicate via HTTP, but we need to communicate with
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
tokens, RID (request ID) and SID (session ID).
Jack Moffitt has a great `blogpost`_ about this and even provides an `example Django application`_ to demonstrate it.
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
browser, where you will need them to attach to the existing session.
These tokens then need to be passed back to converse.js running in your
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
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.
**Here's what's happening:**
The JSON data contains the user's JID (jabber ID), RID, SID and the URL to the
BOSH connection manager.
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 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
====================
......
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