pub async fn handle_post_config<B>(
req: Request<B>,
config: Arc<RwLock<Config>>,
) -> Result<Response<Full<Bytes>>>Expand description
Handle POST /config
Accepts a JSON body representing the new configuration and atomically replaces the current configuration. The new config takes effect immediately for all new incoming proxy connections.
ยงRequest Body
JSON representation of the full Config struct, e.g.:
{
"sites": {
"localhost:8080": {
"address": "localhost:8080",
"directives": [
{ "ReverseProxy": { "to": "localhost:9001" } }
]
}
}
}