Mercurial > prosody-wiki
annotate mod_websocket.wiki @ 414:dc20cb1bb874
add some labels
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 17 Jan 2014 00:52:01 +0100 |
parents | f57c49ef23ec |
children | ff097d886420 |
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 |
16 = Usage = | |
17 | |
408
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
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. |
312 | 19 |
408
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
20 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
|
21 Set it to {{{true}}} to enable cross-domain requests from all websites, |
312 | 22 or specify a list like |
23 {{{ | |
24 cross_domain_websocket = { "http://jabber.org", "http://prosody.im" }; | |
25 }}} | |
118 | 26 |
408
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
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 |
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
28 {{{ |
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
29 consider_websocket_secure = true; |
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
30 }}} |
6c4444345eea
Edited wiki page mod_websocket through web user interface.
florob@babelmonkeys.de
parents:
402
diff
changeset
|
31 |
118 | 32 = Compatibility = |
312 | 33 ||0.9||Works|| |
402 | 34 ||< 0.9||Not supported|| |