rust-web-server 18.17.0

Single-binary web server and reverse proxy: automatic HTTPS (Let's Encrypt), HTTP/1.1, HTTP/2 and HTTP/3, load balancing, auth and rate limiting, configured in one TOML file. Also a Rust library: routing, middleware, MCP server, ORM, background jobs. No hyper, no Tower; HTTP/2 and HTTP/3 framing via h2 and quinn.
Documentation
//! RFC 8941 structured-field pieces for the headers rws writes
//! (`Proxy-Status`, `Cache-Status`).

/// A token as is, anything else as a string (RFC 8941).
pub(crate) fn item(name: &str) -> String {
    let token = !name.is_empty()
        && name.as_bytes()[0].is_ascii_alphabetic()
        && name.bytes().all(|b| b.is_ascii_alphanumeric() || b":/!#$%&'*+-.^_`|~".contains(&b));
    if token {
        name.to_string()
    } else {
        string(name)
    }
}

/// An RFC 8941 string: printable ASCII, `"` and `\` escaped, the rest
/// dropped (header values must stay one safe line).
pub(crate) fn string(s: &str) -> String {
    let mut out = String::with_capacity(s.len() + 2);
    out.push('"');
    for c in s.chars().take(256) {
        match c {
            '"' | '\\' => {
                out.push('\\');
                out.push(c);
            }
            ' '..='~' => out.push(c),
            _ => {}
        }
    }
    out.push('"');
    out
}