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
ProxyConfiginto a liveConfigDrivenAppwith 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 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§
- Cache
Config - Config
Driven App - An
Applicationthat routes requests based on a parsedProxyConfig. - Health
Check Config - Match
Config - Middleware
Config - Proxy
Config - Rate
Limit Config - Rewrite
Rule Config - Route
Config - TcpProxy
Config - UdpProxy
Config - Upstream
Config - WsProxy
Config
Enums§
- Action
Config - Auth
Config - Reload
Outcome - What a successful
ConfigDrivenApp::reload_from_strchanged.
Functions§
- build_
from_ file - Build a
ConfigDrivenAppfromrws.config.tomland spawn L4/WS proxy threads. Returns the app and a list of thread handles.