Conduit_lwt_unixConnection establishment using the Lwt_unix library
Configuration fragment for a TLS client connecting to a remote endpoint
val sexp_of_client_tls_config : client_tls_config -> Sexplib0.Sexp.tval client_tls_config_of_sexp : Sexplib0.Sexp.t -> client_tls_configval sexp_of_ic : ic -> Sexplib0.Sexp.tval ic_of_sexp : Sexplib0.Sexp.t -> icval sexp_of_oc : oc -> Sexplib0.Sexp.tval oc_of_sexp : Sexplib0.Sexp.t -> octype client = [ | `TLS of client_tls_config| `TLS_tunnel of [ `Hostname of string ] * ic * oc| `TLS_native of client_tls_configForce use of native OCaml TLS stack to connect.
*)| `OpenSSL of client_tls_configForce use of Lwt OpenSSL bindings to connect.
*)| `TCP of [ `IP of Ipaddr.t ] * [ `Port of int ]Use TCP to connect to the given ip, port tuple.
| `Unix_domain_socket of [ `File of string ]Use UNIX domain sockets to connect to a socket on the path.
| `Vchan_direct of [ `Domid of int ] * [ `Port of string ]Connect to the remote VM on the domid, port tuple.
| `Vchan_domain_socket of [ `Domain_name of string ] * [ `Port of string ]Use the Vchan name resolution to connect
*) ]Set of supported client connections that are supported by this module:
`TLS (`Hostname host, `IP ip, `Port port): Use OCaml-TLS or OpenSSL (depending on CONDUIT_TLS) to connect to the given host, ip, port tuple via TCP.`TLS_native _: Force use of native OCaml TLS stack to connect.`OpenSSL _: Force use of Lwt OpenSSL bindings to connect.`TCP (`IP ip, `Port port): Use TCP to connect to the given ip, port tuple.`Unix_domain_socket (`File path): Use UNIX domain sockets to connect to a socket on the path.`Vchan_direct (`Domid domid, `Port port): Connect to the remote VM on the domid, port tuple.`Vchan_domain_socket (`Domain_name domain, `Port port_name): Use the Vchan name resolution to connect.val sexp_of_client : client -> Sexplib0.Sexp.tval client_of_sexp : Sexplib0.Sexp.t -> clientval __client_of_sexp__ : Sexplib0.Sexp.t -> clienttype server_tls_config =
[ `Crt_file_path of string ]
* [ `Key_file_path of string ]
* [ `Password of bool -> string | `No_password ]
* [ `Port of int ]Configuration fragment for a listening TLS server
val sexp_of_server_tls_config : server_tls_config -> Sexplib0.Sexp.tval server_tls_config_of_sexp : Sexplib0.Sexp.t -> server_tls_configSet of ways to create TCP servers
`Port port: Create a socket listening to provided port.`Socket file_descr: Use the provided file descriptor to create a server.val sexp_of_tcp_config : tcp_config -> Sexplib0.Sexp.tval tcp_config_of_sexp : Sexplib0.Sexp.t -> tcp_configval __tcp_config_of_sexp__ : Sexplib0.Sexp.t -> tcp_configtype server = [ | `TLS of server_tls_config| `OpenSSL of server_tls_config| `TLS_native of server_tls_config| `TCP of tcp_config| `Unix_domain_socket of [ `File of string ]| `Vchan_direct of int * string| `Vchan_domain_socket of string * string| `Launchd of string ]Set of supported listening mechanisms that are supported by this module.
`TLS server_tls_config: Use OCaml-TLS or OpenSSL (depending on CONDUIT_TLS) to connect to the given host, ip, port tuple via TCP.`TLS_native _: Force use of native OCaml TLS stack to connect.`OpenSSL _: Force use of Lwt OpenSSL bindings to connect.`TCP (`Port port): Listen on the specified TCPv4 port.`Unix_domain_socket (`File path): Use UNIX domain sockets to listen on the path.`Vchan_direct (domid, port): Listen for the remote VM on the domid, port tuple.`Vchan_domain_socket (domain, port_name): Use the Vchan name resolution to listen`Listening_socket fd: Use the socket given, useful for inherited systemd sockets.`Launchd name: uses MacOS X launchd to start the service, via the name of the Sockets element within the service description plist file. See the ocaml-launchd documentation for more.val sexp_of_server : server -> Sexplib0.Sexp.tval server_of_sexp : Sexplib0.Sexp.t -> serverval __server_of_sexp__ : Sexplib0.Sexp.t -> servertcp_flow contains the state of a single TCP connection.
val sexp_of_tcp_flow : tcp_flow -> Sexplib0.Sexp.tdomain_flow contains the state of a single Unix domain socket connection.
val sexp_of_domain_flow : domain_flow -> Sexplib0.Sexp.tvchan_flow contains the state of a single Vchan shared memory connection.
val sexp_of_vchan_flow : vchan_flow -> Sexplib0.Sexp.ttype flow = private | TCP of tcp_flow| Tunnel of string * ic * oc| Domain_socket of domain_flow| Vchan of vchan_flowA flow contains the state of a single connection, over a specific transport method.
val sexp_of_flow : flow -> Sexplib0.Sexp.ttype tls_own_key = [ | `None| `TLS of
[ `Crt_file_path of string ]
* [ `Key_file_path of string ]
* [ `Password of bool -> string | `No_password ] ]Type describing where to locate a PEM key in the filesystem
val sexp_of_tls_own_key : tls_own_key -> Sexplib0.Sexp.tval tls_own_key_of_sexp : Sexplib0.Sexp.t -> tls_own_keyval __tls_own_key_of_sexp__ : Sexplib0.Sexp.t -> tls_own_keyval sexp_of_ctx : ctx -> Sexplib0.Sexp.tval default_ctx : ctx Stdlib.Lazy.tDefault context that listens on all source addresses with no TLS certificate associated with the Conduit
val init :
?src:string ->
?tls_own_key:tls_own_key ->
?tls_authenticator:Conduit_lwt_tls.X509.authenticator ->
?ssl_ctx:Conduit_lwt_unix_ssl.Client.context ->
?ssl_client_verify:Conduit_lwt_unix_ssl.Client.verify ->
unit ->
ctx ioinit ?src ?tls_own_key ?tls_authenticator ?ssl_ctx () will initialize a Unix conduit that binds to the src interface if specified.
If TLS server connections are used, then tls_own_key must contain a valid certificate to be used to advertise a TLS connection. In TLS mode the certificate is validated using tls_authenticator. By default, the validation is using the OS trust anchors.
If SSL client connections are used, then tls_own_key may contain a valid certificate to be used to advertise a TLS connection. If it's not configured ssl_ctx will be used to configure OpenSSL.
connect ~ctx client establishes an outgoing connection via the ctx context to the endpoint described by client
val serve :
?backlog:int ->
?timeout:int ->
?stop:unit io ->
on_exn:(exn -> unit) ->
ctx:ctx ->
mode:server ->
(flow -> ic -> oc -> unit io) ->
unit ioserve ?backlog ?timeout ?stop ~on_exn ~ctx ~mode fn establishes a listening connection of type mode, using the ctx context. The stop thread will terminate the server if it ever becomes determined. Every connection will be served in a new lightweight thread that is invoked via the fn callback. The fn callback is passed the flow representing the client connection and the associated input ic and output oc channels. If the callback raises an exception, it is passed to on_exn.
set_max_active nconn sets the maximum number of active connections accepted. When the limit is hit accept blocks until another server connection is closed.
type endp = [ | Conduit.endp| `TLS_tunnel of string * ic * ocWrap in a TLS channel over an existing Lwt_io.channel connection, hostname,input_channel,output_channel
]val sexp_of_endp : endp -> Sexplib0.Sexp.tval endp_of_sexp : Sexplib0.Sexp.t -> endpval __endp_of_sexp__ : Sexplib0.Sexp.t -> endpendp_of_flow flow retrieves the original endp from the established flow
endp_to_client ~ctx endp converts an endp into a a concrete connection mechanism of type client
val endp_to_server : ctx:ctx -> Conduit.endp -> server ioendp_to_server ~ctx endp converts an endp into a a concrete connection mechanism of type server