annotate mod_compression/README.markdown @ 2484:560378965b82

mod_compression/README: Fix formatting
author Kim Alvefur <zash@zash.se>
date Sun, 05 Feb 2017 14:49:54 +0100
parents b3097323278f
children a5d4a78c7619
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
1 While the bandwidth usage of XMPP isn't that much, compressing the data
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
2 sent to/from your server can give significant benefits to those on slow
2482
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
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
9 mod\_compression implements [XEP-0138], and supports the zlib compression
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
10 algorithm.
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 ## Dependencies
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 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
15 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
16 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
17 your system. There are different ways of doing this depending on your
2484
560378965b82 mod_compression/README: Fix formatting
Kim Alvefur <zash@zash.se>
parents: 2483
diff changeset
18 system. If in doubt whether it is installed correctly, the command
560378965b82 mod_compression/README: Fix formatting
Kim Alvefur <zash@zash.se>
parents: 2483
diff changeset
19 `lua-lzlib` in a console should open a Lua prompt with no errors.
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20
2484
560378965b82 mod_compression/README: Fix formatting
Kim Alvefur <zash@zash.se>
parents: 2483
diff changeset
21 For more information on obtaining lua-zlib for your platform, see the
560378965b82 mod_compression/README: Fix formatting
Kim Alvefur <zash@zash.se>
parents: 2483
diff changeset
22 [dependencies page][doc:depends].
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24 # Usage
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 ``` lua
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 modules_enabled = {
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 -- Other modules
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29 "compression"; -- Enable mod_compression
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 }
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
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
33 ## Configuration
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
35 The compression level can be set using the `compression_level` option
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
36 which can be a number from 1 to 9. Higher compression levels will use
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
37 more resources but less bandwidth.
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
38
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
39 ## Example
2482
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 ``` lua
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
42 modules_enabled = {
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
43 -- Other modules
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
44 "compression"; -- Enable mod_compression
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
45 }
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
46  
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
47 compression_level = 5
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
48 ```