comparison mod_websocket.wiki @ 408:6c4444345eea

Edited wiki page mod_websocket through web user interface.
author florob@babelmonkeys.de
date Sun, 15 Dec 2013 19:38:02 +0000
parents 421d0865f89d
children f57c49ef23ec
comparison
equal deleted inserted replaced
407:f26be0f12027 408:6c4444345eea
1 #summary Simple XMPP-over-websocket support 1 #summary Simple XMPP-over-websocket support
2 #labels Stage-Alpha 2 #labels Stage-Beta
3 3
4 = Introduction = 4 = Introduction =
5 5
6 [http://en.wikipedia.org/wiki/WebSocket WebSockets] is a new protocol for providing web pages with simple two-way communication with a web server. 6 [http://en.wikipedia.org/wiki/WebSocket WebSockets] is a new protocol for providing web pages with simple two-way communication with a web server.
7 This module allows browsers to communicate with Prosody via XMPP over !WebSockets.
8 This usually has less overhead then using [https://prosody.im/doc/modules/mod_bosh BOSH].
9 Note that the [http://tools.ietf.org/html/draft-ietf-xmpp-over-websocket XMPP over !WebSocket specification] has not been finalized yet, and is still evolving.
7 10
8 In our case it is interesting to tunnel XMPP over !WebSockets, as an alternative to e.g. BOSH, !WebSockets having less overhead. 11 There are many JavaScript XMPP libraries capable of utilizing !WebSockets, among them:
9
10 Note that the XMPP over !WebSocket specification has not been finalized, and is still evolving. There are few XMPP libraries capable of !WebSockets, among them:
11 * [https://github.com/sonnyp/lightstring Lightstring] 12 * [https://github.com/sonnyp/lightstring Lightstring]
12 * [https://github.com/strophe/strophejs strophe.js master] 13 * [https://github.com/strophe/strophejs strophe.js >= 1.1.0]
13 * [https://github.com/legastero/stanza.io stanza.io] 14 * [https://github.com/legastero/stanza.io stanza.io]
14 15
15 = Usage = 16 = Usage =
16 17
17 Simply add mod_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. 18 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.
18 19
19 A cross_domain_websocket option is supported. 20 To allow requests that would normally break the Same-Origin policy, the {{{cross_domain_websocket}}} option can be used.
20 Set it to true to enable cross-domain requests from all websites, 21 Set it to {{{true}}} to enable cross-domain requests from all websites,
21 or specify a list like 22 or specify a list like
22 {{{ 23 {{{
23 cross_domain_websocket = { "http://jabber.org", "http://prosody.im" }; 24 cross_domain_websocket = { "http://jabber.org", "http://prosody.im" };
24 }}} 25 }}}
25 26
27 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
28 {{{
29 consider_websocket_secure = true;
30 }}}
31
26 = Compatibility = 32 = Compatibility =
27 ||0.9||Works|| 33 ||0.9||Works||
28 ||< 0.9||Not supported|| 34 ||< 0.9||Not supported||