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§
- a2a_
gateway [route.action] type = "a2a": one public address for an A2A agent running elsewhere (18.18.0, #65).- builder
- Builder: converts a
ProxyConfiginto a liveConfigDrivenAppwith health checkers and L4/WS proxy threads. - health
- Background health-checker for upstream backends.
- llm
[route.action] type = "llm": the LLM proxy from the config file (18.9.0).- mcp_
gateway [route.action] type = "mcp": the MCP gateway from the config file (18.9.0).- parser
- Hand-rolled TOML parser that extracts
[[upstream]],[[route]],[[tcp_proxy]],[[udp_proxy]],[[ws_proxy]]sections fromrws.config.tomlinto a flatSectionMap. - validate
- Static checks for the proxy sections of
rws.config.toml, used byrws --checkand printed at startup. The parser itself is lenient — a typo’d key just leaves a default in place — so this is where a route that points at a missing upstream, an auth secret that isn’t set, or a key the parser never reads gets reported.
Structs§
- Authz
Config [authz]and its[authz.type.<name>]tables.- Breaker
Config [upstream.circuit_breaker]: take a failing backend out of rotation.- Cache
Config - Config
Driven App - An
Applicationthat routes requests based on a parsedProxyConfig. - Fast
CgiAction type = "fastcgi": thecrate::fastcgi::FastCgiConfigfields.- Health
Check Config - Match
Config - Middleware
Config - Mirror
Config [route.middleware.mirror].- Oidc
Route Auth [route.middleware.auth] type = "oidc".- Proxy
Config - Rate
Limit Config - Retry
Config [upstream.retry]: try another backend.- Rewrite
Rule Config - Route
Authz Config [route.middleware.authz].- Route
Config - Sticky
Config [upstream.sticky]: keep a client on one backend with a cookie.- TcpProxy
Config - UdpProxy
Config - Upstream
Config - WafSettings
[route.middleware.waf]/[middleware.waf], parsed;errorsnames values that didn’t parse (rws --checkreports them; the WAF then runs with the rest).- Wasm
Config [route.middleware.wasm].- WsProxy
Config
Enums§
- Action
Config - Auth
Config - Reload
Outcome - What a successful
ConfigDrivenApp::reload_from_strchanged. - Upstream
Host - The
Hosta proxy route sends its upstream.
Functions§
- build_
from_ file - Build a
ConfigDrivenAppfromrws.config.tomland spawn L4/WS proxy threads. Returns the app and a list of thread handles.