Reverse proxy for MontRS local development.
Target Audiences: Application Developers, Framework Contributors, Agents.
montrs-proxy routes <slug>.localhost hostnames to local service ports, with optional TLS via self-signed certificates. It's the bridge between montrs-services daemons and your browser.
- Port management:
api.localhost→127.0.0.1:3001without remembering ports. - TLS in dev: Self-signed cert generation for HTTPS-ready local development.
- Fallback routing: A default target port for unmatched hosts.
- Production reverse proxy: Use a real gateway for production.
- Load balancing: Single target per slug only.
Layer 3, standalone. Works alongside montrs-services (proxy to daemon ports).
- Running multiple dev services with memorable hostnames.
- Testing HTTPS locally.
let proxy = ProxyServer::new(ProxyConfig {
routes: vec![RouteEntry {
slug: "api".into(), target_port: 3001, use_tls: false,
}],
..Default::default()
});
proxy.serve().await?;