Is it possible to use HTTP2 with HTTPListener

Is it possible to use http2 functions with HTTPListeners? I have not heard anything about this, but I heard that new releases of the IIS / asp.net stack support it, so I was hoping that the HTTPListener would also be missed or an alternative would be provided.

If this is not the best way to support http2 working with raw sockets or is it even possible to extend httplistener?

Edit: to clarify, I'm not just looking for a solution that http2 β€œreports”, but one that allows me to actually use http2 with new features, such as clicking content, my use case is that I have a custom CMS (self-recording) server that has extremely low latency (instantly responds to all requests), and the only thing left to optimize is the ability to push content and the possibility of multiplexing, because currently the only acceleration I can hope for is Avoid latency due to the large number of routes

+7
source share
1 answer

HttpListener is a managed "client" for the Windows http.sys kernel module (similar to IIS is also a client). This version of this module that handles HTTP / 2 is apparently only available in Win10 / IE . If you are working in Win10 and an HTTP / 2 connection is made, it will most likely look the same as the HttpListener , since the interface for the http.sys driver abstracts the protocol for HttpListener clients. If something else, it will be an HttpListenerResponse.ProtocolVersion showing HTTP / 2.

If you look at the source of HttpListener , then the http.sys interface will be blob-oriented, simply subscribing to requests and receiving request data in one large blob. This blob forms the basis of the HttpListenerContext managed class, which has request and response data represented as properties. HttpListenerResponse sends the response through http.sys , breaking the data into headers and chunks of data that it provides through the OutputStream property. If multithreading is supported, this public API must change. This is currently not supported, and I assume that they will not change this API, and if HttpListener is supported by HTTP / 2, it will completely abstract HTTP / 2 or provide some kind of WriteAsync multiplexing method at this higher level. It looks like you want to write directly against http.sys in order to take advantage of the lower level protocol.

+8
source

All Articles