Mercurial > prosody-wiki
annotate mod_websocket.wiki @ 475:3cd17a2dd5c6
Created wiki page through web user interface.
author | MWild1@gmail.com |
---|---|
date | Tue, 19 Aug 2014 14:34:36 +0000 |
parents | 8a6190c56c8f |
children |
rev | line source |
---|---|
118 | 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 | 3 |
4 = Introduction = | |
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 | 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 | 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 | 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 | 14 * [https://github.com/legastero/stanza.io stanza.io] |
118 | 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 | 20 = Usage = |
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 | 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 | 26 or specify a list like |
27 {{{ | |
28 cross_domain_websocket = { "http://jabber.org", "http://prosody.im" }; | |
29 }}} | |
118 | 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 | 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. |
37 | |
118 | 38 = Compatibility = |
312 | 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|| |