Adding the rest of WebTransport into Kestrel#42097
Merged
Daniel-Genkin-MS-2 merged 156 commits intodotnet:mainfrom Jul 20, 2022
Merged
Adding the rest of WebTransport into Kestrel#42097Daniel-Genkin-MS-2 merged 156 commits intodotnet:mainfrom
Daniel-Genkin-MS-2 merged 156 commits intodotnet:mainfrom
Conversation
Contributor
Author
Start a webtransport connection
Supported JS client operations
let CERTIFICATE = ""; // TODO UPDATE THIS to the certificate hash that the sample app prints out
let encoder = new TextEncoder('utf-8');
let transport = new WebTransport("https://127.0.0.1:5007", {
serverCertificateHashes:[
{
algorithm: "sha-256",
value: Uint8Array.from(atob(CERTIFICATE), c => c.charCodeAt(0))
}]
})
await transport.ready;
const stream1 = await transport.createUnidirectionalStream();
const writer1 = stream1.getWriter();
writer1.write(new Uint8Array([65, 66, 67, 68, 69, 70, 71, 72, 73, 74]));
const stream2 = await transport.createBidirectionalStream();
const writer2 = stream2.writable.getWriter();
writer2.write(new Uint8Array([66, 67, 68, 69, 70, 71, 72, 73, 74, 75]));
const streamReader = await transport.incomingUnidirectionalStreams.getReader();
const streamResult = await reader.read();
const stream = streamResult.value;
const reader1 = stream1.getReader();
await reader1.read();
const reader2 = stream2.readable.getReader();
await reader2.read(); |
1 task
…ple so server reacts to some particular messages
|
@Daniel-Genkin-MS-2, this change will be considered for inclusion in the blog post for the release it'll ship in. Nice work! Please ensure that the original comment in this thread contains a clear explanation of what the change does, why it's important (what problem does it solve?), and, if relevant, include things like code samples and/or performance numbers. This content may not be exactly what goes into the blog post, but it will help the team putting together the announcement. Thanks! |
JamesNK
reviewed
Jul 18, 2022
halter73
approved these changes
Jul 19, 2022
Member
halter73
left a comment
There was a problem hiding this comment.
I still need to try out the samples, but don't wait on me.
JamesNK
reviewed
Jul 20, 2022
src/Servers/Kestrel/samples/WebTransportInteractiveSampleApp/wwwroot/index.html
Outdated
Show resolved
Hide resolved
Co-authored-by: Aditya Mandaleeka <adityamandaleeka@users.noreply.github.com>
Tratcher
approved these changes
Jul 20, 2022
Member
Tratcher
left a comment
There was a problem hiding this comment.
Just a few minor comments left. Great job!
src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
Outdated
Show resolved
Hide resolved
…aniel-Genkin-MS-2/aspnetcore into t-dagenkin/WebTransport-part-2
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is step two in my implementation of WebTransport support in Kestrel. This PR makes WebTransport functional and will provide a basic API for using it. Step three will be integration tests and maybe adding more features.
Goals of the PR
This PR builds upon my previous one (#41877 ) to add an API that interfaces with the existing Http3 layer in Kestrel and allows the application layer to:
Non-Goals of this PR
Non-goals are tracked in #42788
Inadvertent results of the PR
#42097 (comment)
How to use:
C#: https://github.com/dotnet/aspnetcore/blob/c5e66c255c0254a9be191ee53031cec6b79def48/docs/WebTransport.md
JS: #42097 (comment)
OR
Use the interactive sample called
WebTransportInteractiveSamplein src\Middleware\WebTransport\samples\WebTransportInteractiveSampleAppContributes to: #39583