-
Notifications
You must be signed in to change notification settings - Fork 869
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
WebSockets over HTTP/2 #1375
Comments
Triage: We have interested partner team, but not yet committed. It helps with COGS. Forwarding is directly through |
This should be happening for .NET 7 on both the server and client side, so let's make YARP take advantage of that in 2.0 |
@greenEkatherine as the first step here, can you test YARP 1.1 on .NET 7 with an Http/2 WebSocket client and capture the error here in this issue? It's expected to fail since Kestrel will accept the H2 WS request but YARP won't know what to do with it. We just want to document what that failure looks like. |
I'm running YARP 1.1 with .NET 7, attempting to proxy the Angular CLI development server's WebSocket connection. Here's some information that might be helpful: Request Headers:
Here's the request as logged in ASP.NET Core:
Here's a stack-trace from YARP:
Let me know if I can provide more information. If I've misunderstood and this isn't what you're after, I can delete this comment. |
@serpent5 we know, we haven't implemented that support for YARP yet. Some workarounds in the meantime:
|
Ok, thanks. I understand it's a known limitation. I was just trying to provide more information around the exception to see if it helped. Thanks for the workarounds. In my testing, rejecting the request with |
I know it's a hard question but: do you have any estimated release date for Websockets over HTTP/2? |
Not specifically, but we should start working on it soon. Once it's merged you'll be able to try it from nightly builds and preview releases. What's your interest/dependency on this feature? |
We would need it for Server-Side-Blazor. |
To save people some time: a temporary middleware implementing the fix from above: https://gist.github.com/Lakerfield/0ea3a687974df5192d66a375d78ce0e6 if (context.Request.Method == HttpMethods.Connect && context.Request.Protocol != HttpProtocol.Http11)
{
var resetFeature = context.Features.Get<IHttpResetFeature>();
if (resetFeature != null)
{
//https://www.rfc-editor.org/rfc/rfc7540#page-51
//HTTP_1_1_REQUIRED (0xd): The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
resetFeature.Reset(errorCode: 0xd);
return;
}
} |
Hi |
Yes, you can do any combination of [1.1, 2.0] incoming to [1.1, 2.0] outgoing. |
Yes |
Since which yarp version?
I think it's not in latest published nuget 1.1
|
This will be in the upcoming 2.0-rc.1 release. |
We've heard some interest express for WebSockets support over HTTP/2 in YARP. This would require support in ASP.NET Core (Kestrel) and HttpClient. The protocol is quite different from original WebSockets.
RFC: https://datatracker.ietf.org/doc/html/rfc8441
Kestrel: dotnet/aspnetcore#7801
HttpClient: dotnet/runtime#69669
We'd also need to worry about protocol upgrades/downgrades between front-end and back-end.
The text was updated successfully, but these errors were encountered: