added arguments and support for running locally

This commit is contained in:
2024-07-12 14:26:42 -07:00
parent 9a0c639c96
commit 48aab27d60
4 changed files with 38 additions and 5 deletions

View File

@ -3,7 +3,7 @@
(local handle-client (. (require :client-handler) :handle-client))
(local port 50625)
(local port _G.port)
(local server (socket.tcp))
(server:bind "*" port)
@ -22,8 +22,9 @@
(set (_G.client-address _G.client-port) (client:getpeername))
(set client (ssl.wrap client params))
(client:dohandshake)
(when (not _G.use-http)
(set client (ssl.wrap client params))
(client:dohandshake))
(let [co (coroutine.create (fn [] (handle-client client)))]
(coroutine.resume co)))