-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] List of events #9
Comments
It's hard to give a proper list because each module emits their own events, and modules are pluggable. i.e. we don't control the events that are emitted. There are some standard ones that are pretty common, especially related to TLS automation -- I'd recommend reading the logs for now, until we figure out a way to document the events. This PR describes most of them for now, I think: caddyserver/caddy#4912 |
I see no event name in the logs for a request, it's just Thanks |
There's no event for HTTP requests... there are detailed access logs though. Usually people implement an HTTP handler module for custom HTTP request behavior. |
My use case is server-side analytics, so I'd like to run a script every time Caddy receives a request, without proxying or altering that request in any way. |
Definitely write an http handler module instead; it will perform much better! |
without proxying or altering that request in any way |
Yeah. So write a handler. Don't proxy it or alter anything. (I assume you mean alter not alert) |
I guess I don't understand what you mean. Could you please explain ? Thanks |
Sure -- there's an example on the bottom of this page, which explains how to extend Caddy: https://caddyserver.com/docs/extending-caddy Running a command at every HTTP request will affect requests more than an HTTP handler, which is basically your code that then calls |
Thanks, but I want to write that script in Bash, not Go 😅 |
Then either read the logs in bash, or write a handler to emit an event on HTTP requests. We don't do this already because running a command on every HTTP request is not very performant and can open the door to DoS. |
Hello,
The README uses
cert_obtained
as an example event but what other events are available ?And specifically, what's the event for an HTTP request ?
Thanks
The text was updated successfully, but these errors were encountered: