Modules

Everything outside the core is a module. Modules are compiled in when BareProxy is built, so a binary without a module carries none of its code. Official builds come in two forms: Bare, the core alone, and Full, the core with every module. bareproxy modules lists what a binary contains.

The request pipeline of BareProxy Core, with each module attached at its plug-in point

The Nine Modules

Module What it adds Where it plugs in
BareProxy Static Files and single-page apps served from a folder, with index files and a fallback to index.html A rule’s action
BareProxy Compress gzip and zstd compression, chosen by what the client accepts The response
BareProxy Cache Responses that say they can be cached, kept in memory or on disk, with purge by path prefix Around the backend call
BareProxy Limit Request and connection limits per client address, per rule or per site Before routing
BareProxy Auth API keys, basic auth, or the check handed to an identity service Before routing
BareProxy Split Weighted and canary splits between pools, by percentage or by header A rule’s action
BareProxy Guard Watches proxy errors after an apply, and rolls the change back by itself if they jump Config changes
BareProxy Export Request records sent to OpenTelemetry and log stores The record
BareProxy Fleet One plan applied across many instances, with shared history and request search Config changes and records

Rules Every Module Follows

  • The core never depends on a module. Take any module out and the core still builds and passes all of its tests.
  • Fixed plug-in points. A module hooks in before routing, as a rule’s action, around the backend call, on the response, on the record or on config changes. It can’t change how the core matches requests.
  • The core’s promises still hold. A module’s config lines are checked before they go live. explain shows what the module did to a request, plan reports what a change to its settings affects, and every request it touches still leaves exactly one record.
  • A budget of its own. Each module stays under 1,500 lines of Go and goes through the same tests as the core.

What Modules Look Like in a Config

Each module adds a few lines of its own. Here Limit and Compress apply to the whole site, Static and Split are rule actions, and Cache sits on a pool:

site example.com
  limit 100/s per client
  compress
  route /assets/* -> static /srv/app/assets
  route /api/* -> api strip
  route /* -> split web 90 web-next 10

pool api
  backend 10.0.0.11:8080
  backend 10.0.0.12:8080
  health /healthz
  cache 5m

The config reference covers the core’s own lines.