mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-26 10:37:02 +00:00
Also, separate out RPC encoding from application logic. Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
25 lines
663 B
OCaml
25 lines
663 B
OCaml
(** Run the TLS terminator as a stand-alone Unix process. *)
|
|
|
|
let () = Logging.init ()
|
|
|
|
let main http_addr port =
|
|
Lwt_main.run begin
|
|
let http_service = Capnp_rpc_unix.connect http_addr in
|
|
Tls_terminator.run ~http_service ~port
|
|
end
|
|
|
|
open Cmdliner
|
|
|
|
let http =
|
|
let doc = "The HTTP service to use" in
|
|
Arg.(required @@ opt (some Capnp_rpc_unix.Connect_address.conv) None @@ info ~doc ~docv:"HTTP" ["http"])
|
|
|
|
let tls =
|
|
let doc = "The TLS port on which to listen for incoming connections" in
|
|
Arg.(value @@ opt int 8443 @@ info ~doc ~docv:"PORT" ["port"])
|
|
|
|
let cmd =
|
|
Term.(const main $ http $ tls), Term.info "tls"
|
|
|
|
let () = Term.(exit @@ eval cmd)
|