postrust-proxy 0.4.0

Reverse proxy for Postrust with load balancing and automatic TLS certificates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! File-based configuration loading.

use crate::config::ProxyConfig;
use crate::error::ProxyResult;
use std::path::Path;

/// Load proxy configuration from a TOML file.
pub async fn load_from_file(path: impl AsRef<Path>) -> ProxyResult<ProxyConfig> {
    let content = tokio::fs::read_to_string(path).await?;
    let config: ProxyConfig = toml::from_str(&content)?;
    Ok(config)
}