-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Kestrel: callbacks for HTTP2 events(stream open, stream close, stream error, etc) #53387
Comments
@cyberfirst-developer Thanks for the suggestion! Can you elaborate a little more on what you're trying to achieve? What sort of code would you put in those callbacks? And, to confirm, it sounds like you're not interested in having more logging (or having logging at a different verbosity level), is that right? |
@benjaminpetit May have thoughts about how YARP could use this. |
After some data collection(it can be done now with logging), i want to find suspicious behaviour of clients, and block them.(requests per stream for example). callbacks mostly cuz i want to examine contexts(i store some data here) and may be even replace transport pipe to be able precisely calculate traffic inside. Also i want to be able to block fast if needed(this is why i have some analytics inside proxy app). while YARP not build for this, i am building some DDoS mitigation with it. |
I think your best bet is probably some combination of logging and connection middleware. |
I think I'm going to close this one in favor of #53377. They're slightly different, but I think making sure that appropriate data is exposed for decision making is more widely applicable (not to mention easier to maintain and evolve) than hooks/callbacks. |
Issue with logger capture is that logger don't have access to context. |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I am using Kestrel with YARP in place of nginx, i did implemented some basic ban with ipset for bad requests.
Trying to analyze some behaviour i found that i can't capture HTTP2 events without log tracing. I would have prefered to have inapp callbacks to handle that data.
such inside callbacks can be usefull in advanced usages of Kestrel.(especially with YARP)
Describe the solution you'd like
i see two possible options, one is via ListenOptions, second via DI.
something like that.
Additional context
No response
The text was updated successfully, but these errors were encountered: