You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP/2 extended connect error message doesn't blame the server #111470
System.Net.Http.HttpRequestException: Failed to establish web socket connection over HTTP/2 because extended CONNECT is not supported. Try to downgrade the request version to HTTP/1.1.
Im conecting to a httplistener wich is running net 9, but i gess that the problem was that extended connect was not suported on net 9 not on my server exception should be a bit more clear.
.NET 9 does support extended HTTP/2 connects.
If you want to use WebSockets over H2, you'll have to switch to Kestrel. HttpListener isn't going to support anything modern, see #63941.
Tweaking the exception message to blame the server seems fine.
We could also remove "Failed to establish web socket connection" from the error from HttpClient since we're just dealing with the extended connect at that layer. It's fine to include that at the WS layer.
changed the title [-]Support Extended Connect for http2 and http3[/-][+]HTTP/2 extended connect error message doesn't blame the server[/+]on Jan 15, 2025
I can take this. I’ll update the System.Net.Http-layer diagnostic to identify the HTTP/2 peer server as not supporting extended CONNECT, keep WebSocket-specific wording at the WebSocket layer, and extend the existing HTTP/2 loopback test to cover the message. Please assign it to me if useful.
Activity
dotnet-policy-service commentedon Jan 15, 2025
Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
MihaZupan commentedon Jan 15, 2025
What server are you connecting to? You'll see that exception if it doesn't support HTTP/2 extended connects.
As for HTTP/3, WebTransport is not supported by .NET yet, see #43641.
Mrgaton commentedon Jan 15, 2025
Im conecting to a httplistener wich is running net 9, but i gess that the problem was that extended connect was not suported on net 9 not on my server exception should be a bit more clear.
MihaZupan commentedon Jan 15, 2025
.NET 9 does support extended HTTP/2 connects.
If you want to use WebSockets over H2, you'll have to switch to Kestrel. HttpListener isn't going to support anything modern, see #63941.
Mrgaton commentedon Jan 15, 2025
Okay but to clarify that the problem is onthe server would be great? i will see to migrate whole server
MihaZupan commentedon Jan 15, 2025
Tweaking the exception message to blame the server seems fine.
We could also remove "Failed to establish web socket connection" from the error from HttpClient since we're just dealing with the extended connect at that layer. It's fine to include that at the WS layer.
[-]Support Extended Connect for http2 and http3[/-][+]HTTP/2 extended connect error message doesn't blame the server[/+]Mrgaton commentedon Jan 15, 2025
I'm trying Kestrel and I see a lot of latency increase just in localhost where httplistener gets around 1-3 ms Kestrel gets around 90-110 ms
MihaZupan commentedon Jan 15, 2025
You're likely measuring the startup overhead (including jitting).
If you're seeing actual performance problems with Kestrel when running benchmarks, please file an issue in https://github.com/dotnet/aspnetcore.
Mrgaton commentedon Jan 15, 2025
im measuring the web browser latency a bunch of times and that is the average i get
when the simple httplistener gets aroun 1-3 as i said. try it yourself
Boulea7 commentedon Aug 11, 2026
Boulea7 commentedon Aug 11, 2026
fzlzjerry commentedon Aug 11, 2026
I can take this. I’ll update the
System.Net.Http-layer diagnostic to identify the HTTP/2 peer server as not supporting extended CONNECT, keep WebSocket-specific wording at the WebSocket layer, and extend the existing HTTP/2 loopback test to cover the message. Please assign it to me if useful.