Skip to main content

Crate postrust_proxy

Crate postrust_proxy 

Source
Expand description

§Postrust Proxy

High-performance reverse proxy module for Postrust with:

  • HTTP/1.1 and HTTP/2 support
  • Load balancing (round-robin, random, least-connections, weighted, sticky)
  • Active health checking
  • Rate limiting
  • Automatic TLS via Let’s Encrypt (ACME)
  • Zero-downtime configuration updates

§Architecture

The proxy is built on vendored code from rust-rpxy, with additional features for database-backed configuration, health checking, and rate limiting.

┌─────────────────────────────────────────────────────────────┐
│                     Postrust Proxy                          │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │   Config    │  │   Health    │  │     Rate Limit      │  │
│  │ TOML + DB   │  │   Checker   │  │    Token Bucket     │  │
│  └──────┬──────┘  └──────┬──────┘  └──────────┬──────────┘  │
│         │                │                    │              │
│         └────────────────┼────────────────────┘              │
│                          │                                   │
│              ┌───────────▼───────────┐                       │
│              │    Vendored Core      │                       │
│              │  (from rust-rpxy)     │                       │
│              │  - Proxy handler      │                       │
│              │  - Load balancer      │                       │
│              │  - HTTP forwarding    │                       │
│              └───────────────────────┘                       │
└─────────────────────────────────────────────────────────────┘

Re-exports§

pub use config::Backend;
pub use config::ProxyConfig;
pub use config::Route;
pub use config::Upstream;
pub use health::HealthChecker;
pub use ratelimit::RateLimiter;

Modules§

admin
Admin REST API and UI for proxy management.
config
Configuration types and loaders for the proxy.
health
Active health checking for backend servers.
ratelimit
Rate limiting for the proxy.
saas
SaaS Domain Management Module
tls
TLS and ACME certificate management.
vendored
Vendored proxy logic from rust-rpxy.

Structs§

ProxyState
Proxy server state shared across handlers.

Enums§

ProxyError
Errors that can occur in the proxy module.

Type Aliases§

ProxyResult
Result type for proxy operations.