cloudflared-mirror/h2mux/h2_compressor_brotli.go

22 lines
380 B
Go
Raw Normal View History

// +build cgo
package h2mux
import (
"io"
"github.com/cloudflare/brotli-go"
)
func CompressionIsSupported() bool {
return true
}
func newDecompressor(src io.Reader) *brotli.Reader {
return brotli.NewReader(src)
}
func newCompressor(dst io.Writer, quality, lgwin int) *brotli.Writer {
return brotli.NewWriter(dst, brotli.WriterOptions{Quality: quality, LGWin: lgwin})
}