Skip to main content

serve_on_with

Function serve_on_with 

Source
pub async fn serve_on_with<F>(
    listener: Listener,
    handler: F,
    upgrades: Vec<(&str, UpgradeHandler)>,
) -> Result<()>
where F: FnMut(HttpRequest) -> HttpResponse + Send + 'static,
Expand description

serve_on with a table of protocol-upgrade paths (see UpgradeHandler) — a GET to one of them, asking to upgrade, is answered 101 and handed off instead of reaching handler. Every other request is unaffected, so serve_on(l, h) is exactly serve_on_with(l, h, []).