mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-24 05:17:02 +08:00
TUN-528: Move cloudflared into a separate repo
This commit is contained in:
21
h2mux/h2_compressor_brotli.go
Normal file
21
h2mux/h2_compressor_brotli.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// +build cgo
|
||||
|
||||
package h2mux
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"code.cfops.it/go/brotli"
|
||||
)
|
||||
|
||||
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})
|
||||
}
|
||||
Reference in New Issue
Block a user