Documentation

Hale.Http3.Network.HTTP3.Server

An HTTP/3 request with parsed headers and body reader. $$\text{H3Request} = \{ \text{method} : \text{String},\; \text{path} : \text{String},\; \ldots \}$$

  • method : String

    The HTTP method (from :method pseudo-header).

  • path : String

    The request path (from :path pseudo-header).

  • scheme : String

    The scheme (from :scheme pseudo-header).

  • authority : String

    The authority (from :authority pseudo-header).

  • headers : List (String × String)

    Regular (non-pseudo) headers.

  • readBody : IO ByteArray

    IO action to read the next chunk of the request body. Returns empty ByteArray when body is exhausted.

Instances For
    Equations
    Instances For

      An HTTP/3 response. $$\text{H3Response} = \{ \text{status} : \mathbb{N},\; \text{headers} : \text{List}(\ldots),\; \text{body} : \text{ByteArray} \}$$

      Instances For
        @[reducible, inline]

        HTTP/3 request handler type. $$\text{H3Handler} = \text{H3Request} \to \text{IO}(\text{H3Response})$$

        Equations
        Instances For

          Encode an HTTP/3 response as HEADERS + DATA frames on a QUIC stream. $$\text{sendResponse} : \text{QUICStream} \to \text{H3Response} \to \text{IO}(\text{Unit})$$

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Handle a single HTTP/3 request stream. Reads frames from the stream, parses the request, invokes the handler, and sends the response. $$\text{handleRequestStream} : \text{QUICStream} \to \text{H3Handler} \to \text{IO}(\text{Unit})$$

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Handle an HTTP/3 connection. Opens control streams, sends SETTINGS, and processes request streams. $$\text{handleConnection} : \text{Connection} \to \text{H3Settings} \to \text{H3Handler} \to \text{IO}(\text{Unit})$$

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For