Esc

ws_upgrade

procedureextensionsince 0.36.1Source
  • macOS: ws_upgrade works on macOS
  • Linux: ws_upgrade works on Linux
  • Windows: ws_upgrade works on Windows
  • Wasm: ws_upgrade works on Wasm

Validates an upgrade and returns a routed response. Example: return ws_upgrade(request, echo). The callback borrows the connection until it returns; config.protocols and data must outlive it.

Signature

ws_upgrade :: (
    request: *Http.Request,
    handler: Ws_Handler,
    data: *void = null,
    config := Ws_Config.{}
) -> Http.Response

See also