| Crates.io | haproxy-brotli |
| lib.rs | haproxy-brotli |
| version | 0.1.0 |
| created_at | 2025-09-19 15:11:31.962155+00 |
| updated_at | 2025-09-19 15:11:31.962155+00 |
| description | HAProxy filter for brotli compression support |
| homepage | |
| repository | https://github.com/khvzak/haproxy-brotli |
| max_upload_size | |
| id | 1846598 |
| size | 31,494 |
A Rust-based brotli module for HAProxy 3.2+ Community Edition using the Lua Filter API.
It implemented as a native Lua module written in Rust using mlua and haproxy-api crates.
Please check the module and tests directories for working examples.
global
master-worker
lua-load-per-thread brotli.lua
...
listen http-in
bind *:8080
filter lua.brotli offload type:text/,application/json
Create a file named brotli.lua with the following content:
local brotli = require("haproxy_brotli_module")
brotli.register()
Only GET/POST requests with the Accept-Encoding: br header will be compressed.
The filter lua.brotli directive supports the following options:
offload: Remove the Accept-Encoding header to prevent backend servers from compressing responses.type: A comma-separated list of MIME type prefixes to compress. Default is empty (all types).quality:N Compression quality level (0-11). Default is 5.window:N The sliding window size (in bits) to use for compression (10-24). Default is 22.This project is licensed under the MIT license