Version: v0.19.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2021 License: BSD-2-Clause Imports: 11 Imported by: 0



Package compress implements XEP-0138: Stream Compression and XEP-0229: Stream Compression with LZW.

Be advised: stream compression has many of the same security considerations as TLS compression (see RFC3749 §6) and may be difficult to implement safely without special expertise.



View Source
const (
	NSFeatures = ""
	NSProtocol = ""

Namespaces used by stream compression.


This section is empty.


func New

func New(methods ...Method) xmpp.StreamFeature

New returns a new xmpp.StreamFeature that can be used to negotiate stream compression. The returned stream feature always supports ZLIB compression; other compression methods are optional.


type Method

type Method struct {
	Name    string
	Wrapper func(io.ReadWriter) (io.ReadWriter, error)

Method is a stream compression method. Custom methods may be defined, but generally speaking the only supported methods will be those with names defined in the "Stream Compression Methods Registry" maintained by the XSF Editor:

Since ZLIB is always supported, a Method is not defined for it.

var (
	// LZW implements stream compression using the Lempel-Ziv-Welch (DCLZ)
	// compressed data format.
	LZW Method = lzwMethod

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto