Description
Is there an existing issue for this?
- 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