aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorame <[email protected]>2026-06-08 22:43:05 -0500
committerame <[email protected]>2026-06-08 22:43:05 -0500
commit66aedfd65cff3494b70e8072646094479e3bfed8 (patch)
tree0106935549143d542819da445e9a74740d617d94 /docs
parent4cbf47f295fc65e4a470d93194259d80c942b32b (diff)
net util
Diffstat (limited to 'docs')
-rw-r--r--docs/net/listen.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/net/listen.md b/docs/net/listen.md
index 39b0f95..420a609 100644
--- a/docs/net/listen.md
+++ b/docs/net/listen.md
@@ -118,6 +118,8 @@ res:send("<h1>hello world</h1>")
functionaly identical to res:write and res:close
+sets res.open to false
+
#### res:close
res:close()
@@ -128,6 +130,8 @@ this will still run any selected functions!
this is called automatically when there are no more function
+sets res.open to false
+
#### res:stop
res:stop()
@@ -174,6 +178,25 @@ options table
res:sendfile("./html/index.html")
```
+sets res.open to false
+
+### res:error
+
+res:error(code)
+
+sends an error message to the client
+
+```lua
+res:error(404)
+
+-- HTTP/1.1 404 Not Found
+-- ...
+--
+-- not found
+```
+
+sets res.open to false
+
### res:upgrade
res:upgrade()
@@ -197,6 +220,10 @@ res:write** - sends data as an incomplete frame
res:sendfile** - sends file to the client
res:close** - same function
+### res.open
+
+boolean determining if the connection has been closed via res:send or res:close
+
### req.parameters
a list of parematers for the current function