Adding datagrams support to WebTransport
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
I implemented streams over WebTransport but did not have time to also implement datagrams. Adding datagram support would make the API more useful and help to provide a more universal implementation that is more consistent with the WebTransport spec. Currently, to allow WebTransport to function with the Chromium WebTransport implementation, we fake supporting datagrams and just ignore them whenever they are received.
### Describe the solution you'd like
Datagrams actually extend beyond just WebTransport. In fact, there is a "datagrams over HTTP/3" specification (https://datatracker.ietf.org/doc/html/draft-ietf-masque-h3-datagram-11). The main challenge will actually be the datagrams over HTTP/3 implementation rather than datagrams over WebTransport as the WebTransport side should be relatively trivial (https://ietf-wg-webtrans.github.io/draft-ietf-webtrans-http3/draft-ietf-webtrans-http3.html#name-datagrams).
The ideal flow is to have datagram streams (preferably via the `ConnectionContext` type) that the application can accept. Then the application will be able to read and write the same way they currently do for WebTransport streams.
This functionality will also have the added benefit of more detailed error and close messages in the WebTransport session. This will help to make more meaningful logs when something unexpected happens as WebTransport carries error messages as datagrams over the connect stream.
### Additional context
_No response_
Contributor guide
Research direction
Start with the ConnectionContext type and compare the existing WebTransport streams behavior with the linked WebTransport and HTTP/3 datagram specifications. Investigate how datagram streams could be accepted and read or written, with particular attention to the HTTP/3 implementation. Done means WebTransport datagrams are supported instead of ignored, including the described error and close messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100