package paf

  1. Overview
  2. Docs
HTTP/AF and MirageOS

Install

Dune Dependency

Authors

Maintainers

Sources

paf-0.1.0.tbz
sha256=24826310211b6a36aea306d7a2dd7dbed883853a4601089208163400764ec993
sha512=2fb74889bad5d5a9164fa77618de1f96a89037a7fbe9b8f849933188fc2432ab4be99b298b871a2831e421963667a974bea3a329a471b5ab0b0787552d622f56

doc/paf.mirage/Paf_mirage/index.html

Module Paf_mirageSource

Sourcemodule type S = sig ... end
Sourcemodule Make (Time : Mirage_time.S) (Stack : Tcpip.Tcp.S) : S with type stack = Stack.t and type TCP.flow = Stack.flow and type ipaddr = Stack.ipaddr

Client implementation.

The client implementation of Paf_mirage does not strictly need a functor. Indeed, the client was made in the sense of mimic. The user should provide a Mimic.ctx which generate a paf_transmission. By this way, the run function is able to introspect the used protocol (regardless its implementation) and do the ALPN challenge with the server.

Sourcetype transmission = [
  1. | `Clear
  2. | `TLS of string option
]
Sourceval paf_transmission : transmission Mimic.value
Sourceval run : sleep:Paf.sleep -> ctx:Mimic.ctx -> error_handler:(Mimic.flow -> Alpn.client_error -> unit) -> response_handler:(Mimic.flow -> Alpn.response -> Alpn.body -> unit) -> [ `V1 of Httpaf.Request.t | `V2 of H2.Request.t ] -> (Alpn.body, [> Mimic.error ]) result Lwt.t

run ~ctx ~error_handler ~response_handler req sends an HTTP request (H2 or HTTP/1.1) to a peer which can be reached via the given Mimic's ctx. If the connection is recognized as a tls_protocol, we proceed an ALPN challenge between what the user chosen and what the peer can handle. Otherwise, we send a simple HTTP/1.1 request or a h2c request.

Sourcemodule TCPV4V6 (Stack : Tcpip.Stack.V4V6) : sig ... end
OCaml

Innovation. Community. Security.