Software /
code /
prosody-modules
Annotate
mod_compression/README.markdown @ 2482:c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 05 Feb 2017 14:40:51 +0100 |
child | 2483:b3097323278f |
rev | line source |
---|---|
2482
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 While the bandwidth usage of XMPP isn't great, compressing the data sent |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 to/from your server can give significant benefits to those on slow |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 connections, such as dial-up or mobile networks. Prosody supports |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 compression for client-to-server (if your client supports it) and |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 server-to-server streams using the mod\_compression plugin. |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 # Details |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 mod\_compression implements |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 [XEP-0138](http://xmpp.org/extensions/xep-0138.html "http://xmpp.org/extensions/xep-0138.html"){.urlextern}, |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 and supports the zlib compression algorithm. |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 ## Dependencies |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 The XMPP protocol specifies that all clients and servers supporting |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 compression must support the "zlib" compression method, and this is what |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 Prosody uses. However you will need to install zlib support for Lua on |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 your system. There are different ways of doing this depending on your |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 system. If in doubt whether it is installed correctly, the command \`lua |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 -lzlib\` in a console should open a Lua prompt with no errors. |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 For more information on obtaining lua-zlib for your platform, see our |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 [dependencies page](/doc/depends#lua-zlib "doc:depends"){.wikilink1}. |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 # Usage |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 ``` lua |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 modules_enabled = { |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 -- Other modules |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 "compression"; -- Enable mod_compression |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 } |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 ``` |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 Configuration |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 ------------- |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 Option Default Notes |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
38 -------------------- --------- -------------------------------------------------------------------------------------------------------------------- |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 compression\_level 7 Can be a number from 1 to 9, where 9 is best. Higher compression levels will use more resources but less bandwidth |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 Example |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 ------- |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 ``` lua |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 modules_enabled = { |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 -- Other modules |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 "compression"; -- Enable mod_compression |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 } |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 compression_level = 5 |
c96a53b0b820
mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 ``` |