annotate mod_compression/README.markdown @ 2640:c06c59b99b3c

mod_list_active: Actually invert condition (thanks Dan)
author Kim Alvefur <zash@zash.se>
date Wed, 22 Mar 2017 17:34:16 +0100
parents a5d4a78c7619
children
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
2486
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
19 `lua -lzlib` in a console should open a Lua prompt with no errors.
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
20
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
21 Debian/Ubuntu
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
22 : `apt-get install lua-zlib`
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23
2486
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
24 LuaRocks
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
25 : `luarocks install lua-zlib`
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
26
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
27 Source
a5d4a78c7619 mod_compression/README: Include lua-zlib installation instructions and link to source
Kim Alvefur <zash@zash.se>
parents: 2484
diff changeset
28 : <https://github.com/brimworks/lua-zlib>
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 # Usage
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 ``` lua
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 modules_enabled = {
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 -- Other modules
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35 "compression"; -- Enable mod_compression
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 ```
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 ## Configuration
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
40
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
41 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
42 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
43 more resources but less bandwidth.
2482
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
44
2483
b3097323278f mod_compression/README: Some cleanup and rewording
Kim Alvefur <zash@zash.se>
parents: 2482
diff changeset
45 ## Example
2482
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 ``` lua
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
48 modules_enabled = {
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
49 -- Other modules
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
50 "compression"; -- Enable mod_compression
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
51 }
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
52  
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
53 compression_level = 5
c96a53b0b820 mod_compression: Import from Prosody, revision 0c69305ab525
Kim Alvefur <zash@zash.se>
parents:
diff changeset
54 ```