Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented Dec 22, 2022

Fixes #1375

Before this change the forwarder assumed that WebSockets always had to be forwarded using HTTP/1.1. Now it will honor the version and policy settings to decide which outgoing protocol to use. Request and response headers are adapted as needed. If HTTP/2 doesn't work then it can re-try with HTTP/1.1.

Notes:

  • SocketsHttpHandler auto-flushes writes for HTTP/1.1 WebSockets, but not for HTTP/2. We have to manually flush writes.
  • Something is hanging when YARP tries HTTP/2 prior knowledge to a non-TLS HTTP/1.1 endpoint. Hang when HTTP/2 WebSocket connects to a HTTP/1.1 non-TLS kestrel endpoint runtime#80056
  • HttpSys is used as a negative test server because it doesn't support H2WS. This requires TLS, so we use the ports registered for IIS Express's certificate.
  • Added a lot of logging infrastructure
  • Updated Docs

@Tratcher Tratcher added this to the YARP 2.0.0 milestone Dec 22, 2022
@Tratcher Tratcher self-assigned this Dec 22, 2022
Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I take it the telemetry for H2 WebSockets also "just work ™️" because ASP.NET exposes them the same way as H1?

@Tratcher
Copy link
Member Author

Nice! I take it the telemetry for H2 WebSockets also "just work ™️" because ASP.NET exposes them the same way as H1?

Nope, had to add it there too 😁

@Tratcher Tratcher marked this pull request as ready for review December 28, 2022 01:01
@Tratcher Tratcher enabled auto-merge (squash) January 4, 2023 19:10
@Tratcher Tratcher merged commit f2ac5db into main Jan 4, 2023
@Tratcher Tratcher deleted the tratcher/h2ws branch January 4, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebSockets over HTTP/2
3 participants