Skip to content

Kestrel: callbacks for HTTP2 events(stream open, stream close, stream error, etc) #53387

Closed
@cyberfirst-developer

Description

@cyberfirst-developer

Is there an existing issue for this?

  • I have searched the existing issues

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.

ListenOptions.UseHttp2Callbacks(c=>{
    c.OnStreamOpened = async (connectionContext, StreamContext, StreamId) => {...};
    c.OnStreamClosed = async (connectionContext, StreamId, error) => {...}
});

something like that.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions