No matching definitions.

httpd/tls

src/httpd/tls.tur

TLS-terminating listener for upgrade-aware handlers (HTTPS / wss).

Since: WS4 (on stdlib httpd since tourist-on-stdlib-httpd H2)

defn

server-start-tls-conn

(server-start-tls-conn [port : int cert-path : cstr key-path : cstr handler : (c-fn [int int])

bind a TLS listener and dispatch to a two-arg

portTCP port to bind on (127.0.0.1 unless the program called
httpd-set-bind-any! / httpd-set-bind-addr!).
cert-pathfilesystem path to a PEM server cert (+ optional chain).
key-pathfilesystem path to the matching PEM private key (unencrypted).
handlercaptureless `(c-fn [int int] int)`. Define it as a top-level
`(defn h [conn : Conn req : Request] : Response ...)`.

:ptr<void> -- opaque server handle for server-stop-tls, or NULL on bind / cert-load / thread-spawn failure.

(let [srv (server-start-tls-conn 8443 "cert.pem" "key.pem" ws-handler)]
    ;; ... wait / signal ...
    (server-stop-tls srv))

Since: WS4

defn

server-stop-tls

(server-stop-tls [srv ptr<void>] :)

shut down a TLS server started by server-start-tls-conn.

srvhandle from server-start-tls-conn (NULL is a safe no-op).

Since: WS4

Internal definitions
htls-null-ptr
htls-null?
htls-start