package capnp-rpc-unix

  1. Overview
  2. Docs
Cap'n Proto is a capability-based RPC system with bindings for many languages

Install

Dune Dependency

Authors

Maintainers

Sources

capnp-rpc-2.1.tbz
sha256=4b59a4147cf6e49c650dbfa4cdb918aec3be69cffd1ef6b5c818584464feb987
sha512=69114597e9cd8ad42c72c1751796b216f98f2a9f09f50a0628b4a3259c2f9b169fd47a73be7b76cfda298a6c202bc79762116865272e35ca0d0914242ace34d7

doc/capnp-rpc-unix/Capnp_rpc_unix/Vat_config/index.html

Module Capnp_rpc_unix.Vat_configSource

Configuration for a Vat.

Sourcetype t
Sourceval create : ?backlog:int -> ?public_address:Network.Location.t -> secret_key:[< `File of _ Eio.Path.t | `PEM of string | `Ephemeral ] -> ?serve_tls:bool -> net:_ Eio.Net.t -> Network.Location.t -> t

create ~secret_key ~net listen_address is the configuration for a server vat that listens on address listen_address. secret_key may be one of:

  • `File path: a PEM-encoded RSA private key is read from path. If path doesn't yet exist, a new key is created and stored there.
  • `PEM data: the given PEM-encoded data is used as the key.
  • `Ephemeral: a new key is generated (if needed) and not saved anywhere. If serve_tls is false then the vat accepts unencrypted incoming connections. If true (the default), the vat performs a server TLS handshake, using secret_key to prove its identity to clients. backlog is passed to Unix.listen. The vat will suggest that others connect to it at public_address (or listen_address if no public address is given).

secret_key t returns the vat's secret yet, generating it if this is the first time it has been used.

Sourceval hashed_secret : t -> string

hashed_secret t is the SHA256 digest of the secret key file. This is useful as an input to Restorer.Id.derived.

Sourceval derived_id : t -> string -> Capnp_rpc_net.Restorer.Id.t

derived_id t name is a secret service ID derived from name and the vat's secret key (using Restorer.Id.derived). It won't change (unless the vat's key changes).

Sourceval sturdy_uri : t -> Capnp_rpc_net.Restorer.Id.t -> Uri.t

sturdy_uri t id is a sturdy URI for id at the vat that would be created by t.

Sourceval pp : t Fmt.t

This is probably only useful for the unit-tests.

Sourceval equal : t -> t -> bool

This is probably only useful for the unit-tests.

Sourcetype 'a env = 'a constraint 'a = < net : _ Eio.Net.t ; fs : _ Eio.Path.t.. > as 'a
Sourceval cmd : _ env -> t Cmdliner.Term.t

cmd env evaluates to a configuration populated from the command-line options.

OCaml

Innovation. Community. Security.