view @ 445:8a6190c56c8f

Add note about requirement for LuaBitOp library (thanks Jonathan)
date Fri, 28 Mar 2014 14:26:45 +0000
parents ff097d886420
line wrap: on
line source

#summary Simple XMPP-over-websocket support
#labels Stage-Beta

= Introduction =

[ WebSockets] is a new protocol for providing web pages with simple two-way communication with a web server.
This module allows browsers to communicate with Prosody via XMPP over !WebSockets.
This usually has less overhead then using [ BOSH].
Note that the [ XMPP over !WebSocket specification] has not been finalized yet, and is still evolving.

There are many JavaScript XMPP libraries capable of utilizing !WebSockets, among them:
  * [ Lightstring]
  * [ strophe.js >= 1.1.0]
  * []

= Installation =

Installation is the same as any other module. Note that you will need a Lua bit library installed, for example [ LuaBitOp] (`lua-bitop` package in Debian/Ubuntu and `luabitop` in LuaRocks).

= Usage =

Simply add {{{"websocket"}}} to your {{{modules_enabled}}} list, as you would any other module. The repository includes a demo websocket.html file to show connecting to the socket. It doesn't perform any XMPP.

To allow requests that would normally break the Same-Origin policy, the {{{cross_domain_websocket}}} option can be used.
Set it to {{{true}}} to enable cross-domain requests from all websites,
or specify a list like
cross_domain_websocket = { "", "" };

If encryption is provided by a HTTP proxy Prosody won't be able to see this, and consider the connection insecure (consequently forbidding some authentication mechanisms). In this case Prosody can be told to always consider !WebSocket connections secure by setting
consider_websocket_secure = true;

The WebSocket endpoint will be at {{{wss://}} and {{ws://}} by default, see [ HTTP path configuration] if you would like to change it.

= Compatibility =
||< 0.9||Not supported||