Mercurial > prosody-wiki
annotate mod_websocket.wiki @ 427:ff097d886420
add info about default endpoint
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 13 Feb 2014 22:24:03 +0100 |
parents | f57c49ef23ec |
children | 8a6190c56c8f |
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 |
427 | 32 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. |
33 | |
118 | 34 = Compatibility = |
312 | 35 ||0.9||Works|| |
427 | 36 ||< 0.9||Not supported|| |