Re:Althttpd: Simple webserver in a single C file
by eatonphil on Tuesday June 08, 2021 @06:42AM
(#27433137)
A big missing feature in Caddy for me is an embedded language like Lua for nginx so you can write tiny hooks. The Caddy authors have indicated on HN a while ago that Caddy 2 may have an embedded scripting language but I can't find anything about it in their docs.
[ Parent
| on HN ]
Re:Althttpd: Simple webserver in a single C file
by coder543 on Tuesday June 08, 2021 @11:08AM
(#27436192)
Seems like it was postponed[0].
For very tiny hooks, you might be able to get away with using request matchers[1] and respond[2].
[0]: https://caddy.community/t/missing-starlark-documentation/958...
[1]: https://caddyserver.com/docs/caddyfile/matchers
[2]: https://caddyserver.com/docs/caddyfile/directives/respond
Re:Althttpd: Simple webserver in a single C file
by francislavoie on Tuesday June 08, 2021 @11:12AM
(#27436248)
Writing plugins for Caddy is so easy that it's generally not necessary to have scripting built-in. You can just build yourself a new binary with a Go plugin just by using the "xcaddy" build tool. https://caddyserver.com/docs/extending-caddy
But yeah, it's still something at the back of our minds, and we were considering Starlark for this, but that hasn't really materialized because it's usually easier to just go with the plugin route.