Middleware Ecosystem

July 13, 2026 · View on GitHub

Read this in English or Português (BR).

Horse keeps a small core. Almost everything you'd associate with a "web framework" — JSON parsing, CORS, JWT, compression, logging — lives in separate, opt-in middleware packages. This page catalogues the official ones (maintained by HashLoad) and the community list.

For how middleware actually works, see Middleware.


Official middleware (HashLoad/*)

For a more maintainable ecosystem, the official middleware lives in separate repositories rather than the Horse core. Install with Boss:

boss install <repo>
MiddlewareWhat it doesDelphiLazarus
horse/jhonsonParses JSON request bodies, serialises JSON responses✔️✔️
horse/basic-authHTTP Basic authentication✔️✔️
horse/corsCross-Origin Resource Sharing headers + preflight✔️✔️
horse/streamapplication/octet-stream body handling✔️✔️
horse/jwtJSON Web Token authentication✔️✔️
horse/exceptionConvert raised exceptions to consistent JSON error responses✔️✔️
horse/loggerPer-request access log✔️✔️
horse/compressiongzip / deflate response compression✔️✔️

Typical composition

uses
  Horse,
  Horse.Jhonson,
  Horse.CORS,
  Horse.HandleException,
  Horse.Logger,
  Horse.JWT;

begin
  THorse
    .Use(Horse.HandleException.New)    // outermost — turn errors into clean responses
    .Use(Horse.Logger.New)             // log every request
    .Use(CORS)                         // CORS headers + OPTIONS preflight
    .Use(Jhonson)                      // parse JSON bodies
    .Use(JWT('secret'));               // require a valid token (innermost)

  // routes …

  THorse.Listen(9000);
end.

Registration order matters — see Middleware.


Third-party middleware (community)

These are not maintained by HashLoad but are listed here because they're commonly used. The list grows over time — open a PR against this doc if yours should be here.

MiddlewareDescriptionDelphiLazarus
bittencourtthulio/etagETag generation✔️✔️
bittencourtthulio/paginateList response pagination✔️✔️
bittencourtthulio/cachecontrolCache-Control response headers✔️
gabrielbaltazar/gbswaggerSwagger / OpenAPI generation✔️
willhubner/socketIOSocket.IO server✔️
dliocode/ratelimitRate limiting✔️
dliocode/slowdownProgressive request delay✔️
giorgiobazzo/uploadFile upload helpers✔️
dliocode/queryQuery-string DSL helpers✔️
CarlosHe/healthcheck/healthz endpoint✔️
CarlosHe/staticfilesStatic file serving✔️
CachopaWeb/horse-server-staticStatic file serving (alternative)✔️✔️
arvanus/horse-exception-loggerException logging✔️✔️
claudneysessa/Horse-CSResponsePaginationResponse pagination✔️
claudneysessa/Horse-XSuperObjectsXSuperObject integration✔️
andre-djsystem/horse-bearer-authBearer-token authentication✔️✔️
andre-djsystem/horse-manipulate-requestRequest mutation helpers✔️✔️
andre-djsystem/horse-manipulate-responseResponse mutation helpers✔️✔️
antoniojmsjr/Horse-IPGeoLocationIP geolocation lookup✔️
antoniojmsjr/Horse-XMLDocXML documentation generation✔️
isaquepinheiro/horse-jsonbrJSON helpers✔️
IagooCesaar/Horse-JsonInterceptorJSON request/response interceptor✔️
dliocode/horse-dataloggerStructured data logger✔️
weslleycapelari/horse-documentationAuto-generated API docs✔️
weslleycapelari/horse-validatorRequest payload validation✔️
regyssilveira/horse-rate-limitRate limiting control with support for multiple backends and storages✔️✔️
regyssilveira/horse-compression-v2High-performance response compression with Gzip, Deflate, and Brotli support✔️✔️
regyssilveira/horse-staticHigh-performance static file serving with Range, Cache, and SPA Fallback support✔️✔️
regyssilveira/horse-dtoAuto-binding and declarative validation middleware✔️✔️
regyssilveira/horse-rbacRole-Based Access Control (RBAC) and scopes middleware✔️✔️
regyssilveira/horse-schema-validationRequest payload schema validation middleware✔️✔️
regyssilveira/horse-multipartMultipart/form-data request body parser middleware✔️✔️
regyssilveira/horse-helmetSecurity headers middleware for HTTP response protection✔️✔️
regyssilveira/horse-ssl-redirectRedirection of insecure HTTP requests to HTTPS with proxy and localhost bypass support✔️✔️
regyssilveira/horse-crudAutomatic and dynamic CRUD routes generation middleware for Horse framework from decorated entities✔️✔️
regyssilveira/horse-request-idRequest ID (Correlation ID) generation and tracking middleware for the Horse framework ecosystem✔️✔️
regyssilveira/horse-sanitizeMiddleware to sanitize request parameters from the Horse ecosystem against XSS and harmful injections✔️✔️

Telemetry

These are middlewares focused on application observability, metrics, and tracing:

MiddlewareDescriptionDelphiLazarus
marcobreveglieri/horse-prometheus-metricsPrometheus metrics endpoint✔️
regyssilveira/horse-opentelemetryOpenTelemetry integration for distributed tracing✔️✔️
regyssilveira/horse-prometheusPrometheus integration for metrics collection✔️✔️

Third-party transport Providers

Beyond middleware, the community has produced alternative transport Providers — the layer Horse uses to own the socket and parse HTTP. This is a separate axis from the middleware list above (see Providers & Application types for the full conceptual model). The actively maintained third-party Providers are:

ProviderDescriptionLicenseRepository
horse-provider-crosssocketAsync IOCP / epoll / kqueue transport. Replaces the default Indy Provider with Delphi-Cross-Socket. Installation is manual (mirrors mORMot2): clone winddriver/Delphi-Cross-Socket + cnpack/cnvcl and add search paths. Supported alternative for mTLS users or single-dependency convenience: freitasjca/Delphi-Cross-Socket v1.0.3 (bundles CnPack + mTLS APIs). Targets high-concurrency deployments. Activated by HORSE_PROVIDER_CROSSSOCKET. Requires Delphi 10.2+ / FPC 3.2+. Baseline test score: 80 passed / 1 failed (the documented Set-Cookie multi-value Horse-core limitation).MITfreitasjca/horse-provider-crosssocket
horse-provider-mormotAsync IOCP / epoll transport. Replaces the default Indy Provider with mORMot2's THttpServer — pure Pascal, no compiled C deps for standard HTTP. Optional swap to THttpApiServer for Windows kernel-mode http.sys. Activated by HORSE_PROVIDER_MORMOT. Compatible with Delphi 7 through 12.3 Athens and FPC 3.2+. Ships cross-product convenience units for Console, VCL, Daemon (Windows TService + POSIX runner), Lazarus LCL, and FPC HTTPApplication.MITfreitasjca/horse-provider-mormot

Both Providers use the same hybrid-interface architecture (IHorseRawRequest / IHorseRawResponse), so every Horse middleware works unchanged under either. The two Provider defines are mutually exclusive — exactly one transport per build.

See Providers & Application types for when to switch off the default Indy transport, the compatibility matrix vs. each Application type, and how to combine the two choices.

Adding your middleware to this list

  1. Publish your package with a Boss-compatible boss.json.
  2. Open a PR against doc/middleware-ecosystem.md adding a row in the appropriate table.
  3. Confirm it compiles on the matrix you're claiming (Delphi / Lazarus).

There's no exclusivity — anyone can publish a Horse-compatible package without coordination.

See also

  • Middleware — the model, how to write your own, registration order.
  • Providers — middleware works across all transports; this is why.