(local socket (require :socket)) (local ssl (require :ssl)) (local handle-client (. (require :client-handler) :handle-client)) (local port 50625) (local server (socket.tcp)) (server:bind "*" port) (server:listen) (local params {:mode "server" :protocol "tlsv1_2" :key "../privkey.pem" :certificate "../fullchain.pem" :cafile "../chain.pem" :verify "none" :options "all"}) (while true (var client (server:accept)) (set (_G.client-address _G.client-port) (client:getpeername)) (set client (ssl.wrap client params)) (client:dohandshake) (let [co (coroutine.create (fn [] (handle-client client)))] (coroutine.resume co)))