Skip to main content

Module proxy_config

Module proxy_config 

Source
Expand description

Config-driven proxy application.

When rws.config.toml contains [[route]] or [[upstream]] sections, ConfigDrivenApp is used as the top-level Application instead of the hardcoded build_app() in main.rs.

§Quick start

# rws.config.toml
[[upstream]]
name = "api"
backends = ["localhost:3000"]

[[route]]
name = "api-proxy"

[route.match]
path = "/api/*"

[route.action]
type = "proxy"

[route.action.proxy]
upstream = "api"

Modules§

builder
Builder: converts a ProxyConfig into a live ConfigDrivenApp with health checkers and L4/WS proxy threads.
health
Background health-checker for upstream backends.
parser
Hand-rolled TOML parser that extracts [[upstream]], [[route]], [[tcp_proxy]], [[udp_proxy]], [[ws_proxy]] sections from rws.config.toml into a flat SectionMap.

Structs§

CacheConfig
ConfigDrivenApp
An Application that routes requests based on a parsed ProxyConfig.
HealthCheckConfig
MatchConfig
MiddlewareConfig
ProxyConfig
RateLimitConfig
RewriteRuleConfig
RouteConfig
TcpProxyConfig
UdpProxyConfig
UpstreamConfig
WsProxyConfig

Enums§

ActionConfig
AuthConfig

Functions§

build_from_file
Build a ConfigDrivenApp from rws.config.toml and spawn L4/WS proxy threads. Returns the app and a list of thread handles.