Skip to main content
Horse has a rich ecosystem of official and community-contributed middlewares, development tools, and supporting libraries that extend its functionality and streamline development.

Package Management

Boss Package Manager

Boss is the recommended package manager for Delphi and Lazarus projects. It simplifies dependency management and makes installing Horse and its middlewares effortless.

Boss on GitHub

View the Boss repository and documentation

Install Boss

Download and set up Boss for your development environment
Installing Horse with Boss:
boss install horse
Installing Middlewares:
boss install horse-cors
boss install horse-jwt
boss install horse-logger
Boss automatically manages dependencies, downloads packages, and configures your project paths.

Horse Wizard

Horse Wizard is a code generation tool that scaffolds Horse projects with boilerplate code, saving you time on initial setup.

Horse Wizard

Generate Horse projects quickly with interactive wizards
Installation:
boss install horse-wizard

Official Middlewares

Official middlewares are maintained by the Horse core team and support both Delphi and Lazarus.

JSON Middleware

horse/json provides automatic JSON serialization and deserialization.

Jhonson (JSON)

Automatic JSON handling for requests and responses
boss install jhonson
uses
  Horse,
  Horse.Jhonson; // JSON middleware

begin
  THorse.Use(Jhonson); // Enable JSON support
  
  THorse.Post('/users',
    procedure(Req: THorseRequest; Res: THorseResponse)
    var
      Body: TJSONObject;
    begin
      Body := Req.Body<TJSONObject>;
      // Process JSON body
      Res.Send<TJSONObject>(Body);
    end);
    
  THorse.Listen(9000);
end.

CORS Middleware

horse/cors handles Cross-Origin Resource Sharing (CORS) headers.

Horse CORS

Enable CORS for cross-origin requests
boss install horse-cors
uses
  Horse,
  Horse.CORS;

begin
  THorse.Use(CORS); // Enable CORS with default settings
  
  THorse.Get('/api/data',
    procedure(Req: THorseRequest; Res: THorseResponse)
    begin
      Res.Send('Accessible from any origin');
    end);
    
  THorse.Listen(9000);
end.

Authentication Middlewares

horse/basic-auth implements HTTP Basic Authentication.

Horse Basic Auth

HTTP Basic Authentication middleware
boss install horse-basic-auth
uses
  Horse,
  Horse.BasicAuthentication;

procedure OnAuthentication(Req: THorseRequest; Res: THorseResponse; 
  Next: TProc);
begin
  if Req.Headers['Authorization'] = 'Basic dXNlcjpwYXNz' then
    Next
  else
    Res.Status(401).Send('Unauthorized');
end;

begin
  THorse.Use(HorseBasicAuthentication(OnAuthentication));
  
  THorse.Get('/protected',
    procedure(Req: THorseRequest; Res: THorseResponse)
    begin
      Res.Send('Protected content');
    end);
    
  THorse.Listen(9000);
end.

Utility Middlewares

Stream/Octet-Stream

Handle binary file uploads and downloads

Exception Handler

Centralized exception handling and logging

Logger

Request and response logging

Compression

Response compression (gzip, deflate)
Installation:
boss install horse-octet-stream
boss install handle-exception
boss install horse-logger
boss install horse-compression

Community Middlewares

The Horse community has created many additional middlewares for specialized use cases.

Performance and Caching

bittencourtthulio/etag - Automatic ETag generation for caching.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✓
bittencourtthulio/cachecontrol - Cache-Control header management.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗
dliocode/ratelimit - Request rate limiting.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗
dliocode/slowdown - Gradual request slowdown on rate limit.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗

Documentation and API Tools

GBSwagger

OpenAPI/Swagger documentation generation

Horse Documentation

API documentation generator

Horse XMLDoc

XML documentation support

File Handling

Upload

File upload handling

Static Files

Serve static files and assets

Server Static

Alternative static file server

Pagination and Data

Paginate

Result pagination helper

CSResponsePagination

Advanced pagination responses

Query Parser

Query string parsing utilities

Monitoring and Logging

Health Check

Service health check endpoints

Exception Logger

Enhanced exception logging

DataLogger

Advanced request/response logging

Prometheus Metrics

Prometheus monitoring integration

Real-time Communication

Socket.IO

WebSocket and Socket.IO support for real-time features
Supports: Delphi ✓ | Lazarus ✗

Advanced Features

andre-djsystem/horse-bearer-auth - Bearer token authentication.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✓
andre-djsystem/horse-manipulate-request - Modify incoming requests.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✓
andre-djsystem/horse-manipulate-response - Modify outgoing responses.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✓
antoniojmsjr/Horse-IPGeoLocation - IP-based geolocation.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗
isaquepinheiro/horse-jsonbr - Enhanced JSON handling.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗
claudneysessa/Horse-XSuperObjects - XSuperObject JSON library integration.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗
IagooCesaar/Horse-JsonInterceptor - Intercept and transform JSON.

GitHub Repository
Supports: Delphi ✓ | Lazarus ✗

Community

Telegram Channel

Join the official Horse community on Telegram for discussions, support, and updates.

Join Telegram Channel

Connect with other Horse developers

GitHub Organization

All Horse projects are hosted under the HashLoad GitHub organization.

HashLoad on GitHub

Browse all Horse repositories and projects

Contributing a Middleware

Have you created a middleware for Horse? Share it with the community!
1

Develop your middleware

Create a useful middleware following Horse conventions and patterns.
2

Publish on GitHub

Open source your middleware with clear documentation and examples.
3

Submit a PR

Add your middleware to the README by submitting a pull request to the Horse repository.
4

Share with community

Announce your middleware in the Telegram channel to get feedback and users.
Community middlewares are listed in the Horse README with compatibility information.

Platform Support

Horse and its official middlewares support:
  • Delphi 13 Florence
  • Delphi 12 Athens
  • Delphi 11 Alexandria
  • Delphi 10.4 Sydney
  • Delphi 10.3 Rio
  • Delphi 10.2 Tokyo
  • Delphi 10.1 Berlin
  • Delphi 10 Seattle
  • Delphi XE8
  • Delphi XE7
Some community middlewares may only support Delphi. Check the compatibility table before installation.

Next Steps

Examples

See real-world examples using middlewares

Contributing

Learn how to contribute to Horse

Build docs developers (and LLMs) love