-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Extended connect support for Webtransport #48962
Comments
As a general rule we don't add support for things that are still in draft mode (which webtransport is.) Besides that, it's unclear to me what you're actually asking for. SETTINGS_WEBTRANSPORT_MAX_SESSIONS is a h3 thing, not a h2 thing. edit: I guess you're asking for something similar to SETTINGS_MAX_CONCURRENT_STREAMS but that's implemented in nghttp2. Node merely exposes it. |
Yes, Webtransport is primarily a http/3 thing. But it has a newer draft specification to map it onto http2. So a client would send:
and a server would reply:
This is the only thing from the new spec, I can not implement on top of node (to my current knowledge). Of course, it was clear to me, that you do not want to implement something complex, while it is still in flow. But this one is rather tiny to unlock. |
We normally take a bottom-up approach. :-) If nghttp2 adds it, then exposing it in node should be uncontroversial. |
I see the suggestion from upstream is to use Making it understand arbitrary settings requires both a new public API and a possibly not insignificant amount of refactoring. I don't plan to work on it but pull request welcome. |
I was actually about the write more or less the same. But it took me some time to understand the API (I worked more with quiche for the http3 stuff). Any suggestions for the arbitrary settings api? My first idea would be an object, the key is the numeric id per spec and value is the value per spec. The other question is, what to do with settings, which are already implemented. So how to sync, for backward compatibility they should be kept. |
My off-the-cuff thinking is that a prototype method is probably the best way to go about it, because that lets you handle existing properties more easily. Like this basically: diff --git a/src/node_http2.cc b/src/node_http2.cc
index 01d0eb3418b..54c20b2ece6 100644
--- a/src/node_http2.cc
+++ b/src/node_http2.cc
@@ -3231,6 +3231,7 @@ void Initialize(Local<Object> target,
Local<FunctionTemplate> setting = FunctionTemplate::New(env->isolate());
setting->Inherit(AsyncWrap::GetConstructorTemplate(env));
+ SetProtoMethod(isolate, setting, "add", Http2Settings::Add);
Local<ObjectTemplate> settingt = setting->InstanceTemplate();
settingt->SetInternalFieldCount(AsyncWrap::kInternalFieldCount);
env->set_http2settings_constructor_template(settingt); |
So maybe like the JS map interface get and set, as the settings will also be received and one might want to query the fields that are set? |
Ok, I have read nghttp2 source code in more detail. |
Draft PR as the first sketch is now available. |
Ok, the PR now passed the tests and should be ready for review. |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
Is already fully implemented. |
What is the problem this feature will solve?
I am currently considering extending my Webtransport node plugin (https://github.com/fails-components/webtransport) with support for webtransport over http/2.
I have two options, wait for the support in libquiche, which currently provides the http/3 implementation, or use node.js native http/2.
Thankfully to
#22959
node.js already supports the extended connect protocol and I thought I have already everything for an implementation.
However, https://datatracker.ietf.org/doc/draft-ietf-webtrans-http2/ also requires in clause 3.1 a SETTINGS_WEBTRANSPORT_MAX_SESSIONS setting on the client and server side.
As far as I understand, I can not do anything on the javascript side and this one needs to be implemented on node.js itself or even nghttp2, if I understand the code correctly.
Can you consider adding this to node? As it is a tiny feature.... (Of course, if required I may also provide a PR the extended connect PR did not look to hard, but I do not have much overview over node.js internals).
Or do I miss sth and I can in fact do it in js.
What is the feature you are proposing to solve the problem?
Add SETTINGS_WEBTRANSPORT_MAX_SESSIONS in the same way as extended connect is handled.
What alternatives have you considered?
Use libquiche when it is ready also for this?
The text was updated successfully, but these errors were encountered: