Sorry if I’ve missed something that’s here already, but couldn’t find anything.
I’m looking to have a way to send a “signal” to my custom module. So far I’ve thought of 3 possible options:
Run a webserver on localhost, listening to a different port. Then in the handler, I can be listening for my event
Trap an OS signal, so I know that something happened (similar idea to how software in general listens to USR1 to reload config). The purpose isn’t to re-read the config, I know how Caddy can do that, it’s just an example of what I mean for capturing signals
Or another idea I’ve had is would I be able to add a command within Caddy? So I could have my own caddy custom-command alongside these? Command Line — Caddy Documentation?
I know the first 2 options would technically be fine and work, but the random 3rd idea sounds like the nicest option if it was possible.
Why do you need a signal? Usually you would want to implement an API endpoint instead, so your module can also work on Windows (and with much greater flexibility than a mere signal offers).