Login
You're viewing the discuss.systems public feed.
  • Aug 17, 2026, 11:51 AM

    This is similar to the LWAN_LUA_METHOD() macro that extends the request metatables, but both have been revamped to be simpler under the hood (to e.g. not require a copy of all the luaL_Reg entries just so a sentinel can be added).

    With LSPs, it's now even possible to add some additional Lua code, so one can create a nicer API on top of some primitives written in C.

    Now I just need to write some applications to actually design good APIs. I might even depart from CivetWeb's APIs.

    💬 1🔄 0⭐ 0

Replies

  • Aug 17, 2026, 11:53 AM

    (I initially chose to implement CivetWeb's API because I noticed that PiHole uses it for its dashboard, and I wanted to try using Lwan to power it instead. I'm not sure if I still want that, so it's possible to have better APIs that play with the way Lwan is structured.)

    💬 1🔄 0⭐ 0
  • Aug 17, 2026, 12:13 PM

    LSPs are also more efficient since I last posted about them. By default they were using chunked encoding, which would send TCP fragments for every text piece in the response, but now buffers the output and sends it in one go. On localhost, this doubled the throughput.

    Another advantage is to be able to parse response headers and whatnot, although I personally don't quite like the way that's defined in CivetWeb's API. It's too "CGI script I used to write in the 90s" for me.

    💬 0🔄 0⭐ 0