-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(unstable): WebTransport #27431
feat(unstable): WebTransport #27431
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a deeper look after holiday break.
Can you please open a PR to https://github.com/mdn/browser-compat-data that adds proper information about Deno having this API supported?
pub(crate) mod webtransport { | ||
// MIT License | ||
// | ||
// Copyright (c) 2023 Luke Curley | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to vendor this code? If so can you please add a link here to the original code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is part of web-transport-quinn
but not exposed as public interface so i had to copy out the parts relying on the underlying web-transport-proto
. this should only be temporary though, all this code will be replaced when hyper
+h3
is ready.
cd50d29
to
6f7e537
Compare
2b1fb7d
to
ad87d6f
Compare
static { | ||
webtransportConnect = async function webtransportConnect(conn, url) { | ||
const { | ||
0: connectTxRid, | ||
1: connectRxRid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I fully grasp this - why are these two functions created in a static block of a class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they access a private field
|
||
let datagram; | ||
try { | ||
datagram = await conn.readDatagram(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this one be unrefed? Won't it cause leaks in tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the connection is closed, this raises. so it breaks the loop. test does not detect any leaks.
028d5e0
to
77ce66f
Compare
Initial implementation of WebTransport client and server!
This is very unstable because the interface should eventually shift to use hyper (h3 is on the 2025 roadmap) instead of manually messing with the the protocol, which will enable integration with Deno.serveHttp/etc and allow WebTransport over h2. This will also let us expose multiplexing.
WebTransport stats will be a followup due to their complexity.
Fixes: #9017