1782
|
1 #summary JSON Encodings for XMPP
|
|
2 #labels Stage-Beta
|
|
3
|
|
4 = Introduction =
|
|
5
|
|
6 This plugin encodes XMPP as JSON. This is an implementation of [http://xmpp.org/extensions/xep-0295.html XEP-0295: JSON Encodings for XMPP].
|
|
7
|
|
8 Simply loading this module makes Prosody accept JSON on C2S streams (legacy XML clients are still supported).
|
|
9
|
|
10 For BOSH, it requires mod_bosh be loaded, and JSON should be directed at the `/jsonstreams` HTTP path.
|
|
11
|
|
12 JSON for S2S isn't supported due to the lack of a discovery mechanism, so we have left that disabled to stay compatible with legacy XML servers.
|
|
13
|
|
14 = Configuration =
|
|
15 Just add `"json_streams"` in your config's global `modules_enabled` list, for example:
|
|
16
|
|
17 {{{
|
|
18 modules_enabled = {
|
|
19 ...
|
|
20 "json_streams";
|
|
21 }
|
|
22 }}}
|
|
23
|
|
24 = Strophe.js plugin =
|
|
25 We also developed a [http://prosody-modules.googlecode.com/hg/mod_json_streams/strophe.jsonstreams.js JSON streams plugin] for the popular [http://code.stanziq.com/strophe strophe.js] library.
|
|
26
|
|
27 Just include it like this after including the strophe library, and your strophe-based client will be speaking JSON:
|
|
28 {{{
|
|
29 <script type="text/javascript" src="strophe.jsonstreams.js"></script>
|
|
30 }}}
|
|
31 Be sure to set the HTTP path to `/jsonstreams`. No other changes are required.
|
|
32
|
|
33 = Compatibility =
|
|
34 ||0.8||Works||
|
|
35 ||trunk||Works||
|
|
36
|
|
37 = Quirks =
|
|
38 * This plugin does not currently work with Prosody's [http://prosody.im/doc/port_multiplexing port multiplexing] feature
|