Created
June 22, 2017 05:39
-
-
Save paurkedal/d41ec36b053b26f445927d954068cfce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'a io = 'a Lwt.t | |
type ic = Lwt_io.input_channel | |
type oc = Lwt_io.output_channel | |
type tls_lib = [`OpenSSL | `Native] | |
module X509_key : sig | |
type t = private { | |
key: string; | |
key_password: (bool -> string) option; | |
cert: string; | |
} | |
val create : | |
key: string -> | |
?key_password: (bool -> string) -> | |
cert: string -> | |
unit -> t | |
end | |
module Context : sig | |
type t | |
val default : t | |
val create : | |
?src: string -> | |
?local_key: X509_key.t -> | |
?authenticator: x509_authenticator -> | |
?preferred_lib: tls_lib list -> | |
unit -> t | |
val src : t -> string option | |
val local_key : t -> X509_key.t option | |
val authenticator : t -> x509_authenticator | |
end | |
module Flow : sig | |
type tcp = private { | |
fd: Lwt_unix.file_descr sexp_opaque; | |
ip: Ipaddr.t; | |
port: int; | |
} | |
type unix_domain = private { | |
fd: Lwt_unix.file_descr sexp_opaque; | |
path: string; | |
} | |
type vchan = private { | |
domid: int; | |
port: string; | |
} | |
type t = private | |
| TCP of tcp | |
| Unix_domain of unix_domain | |
| Vchan of vchan | |
val endp : t -> t -> Conduit.endp | |
end | |
module Client : sig | |
type t | |
val create_tcp : | |
?context: Context.t -> | |
remote_ip: Ipaddr.t -> | |
remote_port: int -> | |
unit -> t | |
val create_tls : | |
?context: Context.t -> | |
?local_key: X509_key.t -> | |
?authenticator: x509_authenticator -> | |
remote_host: string -> | |
remote_ip: Ipaddr.t -> | |
remote_port: int -> | |
unit -> t | |
val create_unix_domain : | |
?context: Context.t -> | |
file: string -> | |
unit -> t | |
val create_vchan : | |
?context: Context.t -> | |
domain: [`Id of int | `Name of string] -> | |
port: string -> | |
unit -> t | |
val resolve_endp : | |
?context: Context.t -> | |
?local_key: X509_key.t -> | |
Conduit.endp -> t io | |
val connect : t -> (flow * ic * oc) io | |
end | |
module Server : sig | |
type t | |
val create_tcp : | |
port: int -> | |
unit -> t | |
val create_tls : | |
?context: Context.t -> | |
?local_key: X509_key.t -> (* Required if missing in context. *) | |
?local_ip: Ipaddr.t -> | |
local_port: int -> | |
unit -> t | |
val create_unix_domain : | |
?context: Context.t -> | |
file: string -> | |
unit -> t | |
val create_vchan : | |
?context: Context.t -> | |
domain: [`Id of int | `Name of string] -> | |
port: string -> | |
unit -> t | |
val create_launchd : | |
?context: Context.t -> | |
name: string -> | |
unit -> t | |
val resolve_endp : | |
?context: Context.t -> | |
?local_key: X509_key.t -> | |
Conduit.endp -> t io | |
val serve : | |
?context: Context.t -> | |
?backlog: int -> | |
?timeout: int -> | |
?stop: unit io -> | |
?on_exn: (exn -> unit) -> | |
?max_active_accept: int -> | |
t -> (flow -> ic -> oc -> unit io) -> unit io | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment