annotate mod_websocket.wiki @ 464:08ecacfce5b2

Created wiki page through web user interface.
author LordVan1701@gmail.com
date Fri, 27 Jun 2014 22:39:59 +0000
parents 8a6190c56c8f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
1 #summary Simple XMPP-over-websocket support
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
2 #labels Stage-Beta
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
3
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
4 = Introduction =
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
5
320
188ff73d261e mod_websocket: Remove duplicate http:// (thanks Link Mauve)
Kim Alvefur <zash@zash.se>
parents: 313
diff changeset
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.
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
7 This module allows browsers to communicate with Prosody via XMPP over !WebSockets.
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
8 This usually has less overhead then using [https://prosody.im/doc/modules/mod_bosh BOSH].
409
f57c49ef23ec Correct websocket-draft URL
florob@babelmonkeys.de
parents: 408
diff changeset
9 Note that the [https://tools.ietf.org/html/draft-ietf-xmpp-websocket XMPP over !WebSocket specification] has not been finalized yet, and is still evolving.
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
10
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
11 There are many JavaScript XMPP libraries capable of utilizing !WebSockets, among them:
312
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
12 * [https://github.com/sonnyp/lightstring Lightstring]
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
13 * [https://github.com/strophe/strophejs strophe.js >= 1.1.0]
402
421d0865f89d Update library state
florob@babelmonkeys.de
parents: 320
diff changeset
14 * [https://github.com/legastero/stanza.io stanza.io]
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
15
445
8a6190c56c8f Add note about requirement for LuaBitOp library (thanks Jonathan)
MWild1@gmail.com
parents: 427
diff changeset
16 = Installation =
8a6190c56c8f Add note about requirement for LuaBitOp library (thanks Jonathan)
MWild1@gmail.com
parents: 427
diff changeset
17
8a6190c56c8f Add note about requirement for LuaBitOp library (thanks Jonathan)
MWild1@gmail.com
parents: 427
diff changeset
18 Installation is the same as any other module. Note that you will need a Lua bit library installed, for example [http://bitop.luajit.org/ LuaBitOp] (`lua-bitop` package in Debian/Ubuntu and `luabitop` in LuaRocks).
8a6190c56c8f Add note about requirement for LuaBitOp library (thanks Jonathan)
MWild1@gmail.com
parents: 427
diff changeset
19
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
20 = Usage =
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
21
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
22 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.
312
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
23
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
24 To allow requests that would normally break the Same-Origin policy, the {{{cross_domain_websocket}}} option can be used.
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
25 Set it to {{{true}}} to enable cross-domain requests from all websites,
312
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
26 or specify a list like
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
27 {{{
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
28 cross_domain_websocket = { "http://jabber.org", "http://prosody.im" };
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
29 }}}
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
30
408
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
31 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
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
32 {{{
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
33 consider_websocket_secure = true;
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
34 }}}
6c4444345eea Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents: 402
diff changeset
35
427
ff097d886420 add info about default endpoint
Kim Alvefur <zash@zash.se>
parents: 409
diff changeset
36 The WebSocket endpoint will be at {{{wss://example.com:5281/xmpp-websocket}} and {{ws://example.com:5280/xmpp-websocket}} by default, see [https://prosody.im/doc/http#path_configuration HTTP path configuration] if you would like to change it.
ff097d886420 add info about default endpoint
Kim Alvefur <zash@zash.se>
parents: 409
diff changeset
37
118
a61452a7f698 Created wiki page through web user interface.
MWild1
parents:
diff changeset
38 = Compatibility =
312
e6cc6bf08560 Update to reflect current status
florob@babelmonkeys.de
parents: 118
diff changeset
39 ||0.9||Works||
445
8a6190c56c8f Add note about requirement for LuaBitOp library (thanks Jonathan)
MWild1@gmail.com
parents: 427
diff changeset
40 ||< 0.9||Not supported||