Skip to main content

serve_with_upgrades

Function serve_with_upgrades 

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

serve with a table of protocol-upgrade paths (see UpgradeHandler) — a GET to one of them carrying Upgrade: websocket is handed to its handler once the handshake is answered, on either engine. A compiled backend whose pages talk to the relay registers /_relay here (relay::RelayHub::upgrades).