-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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: Implement QUIC #21942
base: main
Are you sure you want to change the base?
feat: Implement QUIC #21942
Conversation
8d2f39b
to
84747e1
Compare
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.
nice API 👍
28254df
to
f7eb83e
Compare
37df306
to
aec0bb8
Compare
e208a10
to
6d9a15f
Compare
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 looks pretty good. I agree with @littledivy's comments re: ring.
I think we should consider merging this into ext/net rather than creating a new module, however.
d05ef59
to
823a8f9
Compare
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.
@devsnek this is fantastic work, I'm impressed how few lines of code you needed to implement that 💪
a5b1091
to
7645454
Compare
@devsnek we'll get more reviews in this week and aim to land it for v1.41. |
b7fdfb6
to
001fb6a
Compare
4d4f24e
to
b21790d
Compare
How hard or how long would it take to implement Webtransport with this PR ? My suggestion is : why not adding it at the same time before merging in 1.41 since WT is 76% available on the browsers. Adding a client seems "easy" enough, and a server which is upgrading the QUIC transport connection to a server (somewhat like Websocket works at the moment) |
8638073
to
c8e070f
Compare
Probably should be done in a separate PR imo. I'm really excited about this! Is there any consideration for this in deno 1.43 @bartlomieju? |
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.
Very nicely done. Most of my suggestions are little nits. However, same as @mmastrac, I question whether this should be done as an extra module rather than within ext/net
.
Either way, can you please resolve the merge conflicts?
runtime/js/90_deno_ns.js
Outdated
connectQuic: quic.connectQuic, | ||
listenQuic: quic.listenQuic, | ||
QuicBidirectionalStream: quic.QuicBidirectionalStream, | ||
QuicConn: quic.QuicConn, | ||
QuicListener: quic.QuicListener, | ||
QuicReceiveStream: quic.QuicReceiveStream, | ||
QuicSendStream: quic.QuicSendStream, | ||
}; | ||
|
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.
We can either include these classes in the Deno.*
namespace or make the constructors of these classes illegal. The former adds to the API surface area, but the latter enables such objects to be identified with the use of instanceof
. Which should we do? @bartlomieju
I also think we should merge it into ext/net, and if we want to make protocol that depends on QUIC then we can make module ( i.e WebTransport and Media over Quic (MoQ).. |
4fe503b
to
e2156ca
Compare
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.
Mostly documentation nits.
maxIdleTimeout?: number; | ||
/** Maximum number of incoming bidirectional streams that may be open | ||
* concurrently. | ||
* Default: 100 |
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.
* Default: 100 | |
* @default {100} |
maxConcurrentBidirectionalStreams?: number; | ||
/** Maximum number of incoming unidirectional streams that may be open | ||
* concurrently. | ||
* Default: 100 |
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.
* Default: 100 | |
* @default {100} |
export interface ListenQuicOptions extends QuicTransportOptions { | ||
/** The port to connect to. */ | ||
port: number; | ||
/** A literal IP address or host name that can be resolved to an IP address. */ |
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.
/** A literal IP address or host name that can be resolved to an IP address. */ | |
/** A literal IP address or host name that can be resolved to an IP address. | |
* | |
* @default {"0.0.0.0"} | |
*/ |
Should we also add the same note that Deno.ServeOptions.hostname
has?
accept(): Promise<QuicConn>; | ||
refuse(): Promise<void>; | ||
ignore(): Promise<void>; |
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.
Should these have descriptions?
* which the value has been set. */ | ||
sendOrder?: number; | ||
/** Wait until there is sufficient flow credit to create the stream. | ||
* Defaults to false. |
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.
* Defaults to false. | |
* @default {false} |
export interface QuicSendStreamOptions { | ||
/** Indicates the send priority of this stream relative to other streams for | ||
* which the value has been set. */ | ||
sendOrder?: number; |
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.
What's the default behavior of this property?
Any updates on this? @devsnek @bartlomieju |
Implements a QUIC interface, loosely based on the WebTransport API (a future change could add the WebTransport API, built on top of this one).
quinn is used for the underlying QUIC implementation, for a few reasons: