tangled
alpha
login
or
join now
nilfinx.tngl.sh
/
LPLE
0
fork
atom
LiquidProxy Lua Edition
0
fork
atom
overview
issues
pulls
pipelines
fs is no longer a global :tada:
nilfinx.tngl.sh
2 weeks ago
ed740b9e
5924ba14
+5
-3
3 changed files
expand all
collapse all
unified
split
app
cert.lua
http.lua
main.lua
+1
app/cert.lua
···
1
1
+
local fs = require "fs"
1
2
Key = fs.readFileSync("certs/"..cfg.key)
2
3
Cert = fs.readFileSync("certs/"..cfg.cert)
3
4
+3
-2
app/http.lua
···
1
1
---@type luvit.http
2
2
local http = require "http"
3
3
+
local fs = require "fs"
3
4
4
5
---@param req luvit.http.IncomingMessage
5
6
function HTTPAuth(req)
···
116
117
117
118
if ps.plain then
118
119
require "net".createServer(onConn)
119
119
-
:listen(ps.plain, cfg.host)
120
120
+
:listen(ps.plain)
120
121
LogStarted("HTTP", "plain", ps.plain)
121
122
end
122
123
123
124
if ps.secure then
124
125
require "tls".createServer({key = Key, cert = Cert}, onConn)
125
125
-
:listen(ps.secure, cfg.host)
126
126
+
:listen(ps.secure)
126
127
LogStarted("HTTP", "secure", ps.secure)
127
128
end
+1
-1
main.lua
···
4
4
require "string-extensions"
5
5
require "util"
6
6
7
7
-
_G.fs = require "fs"
7
7
+
local fs = require "fs"
8
8
9
9
---@class config
10
10
_G.cfg = require "default_cfg"