Skip to content
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

Implement HTTP/2 #21504

Closed
DartBot opened this issue Nov 4, 2014 · 21 comments
Closed

Implement HTTP/2 #21504

DartBot opened this issue Nov 4, 2014 · 21 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-as-intended Closed as the reported issue is expected behavior closed-not-planned Closed as we don't intend to take action on the reported issue library-io type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Nov 4, 2014

This issue was originally filed by @sethladd


Looks like HTTP/2 has a lot of implementations.

https://github.com/http2/http2-spec/wiki/Implementations

@iposva-google
Copy link
Contributor

Added Library-IO, Area-Library, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Nov 11, 2014

Removed Type-Defect label.
Added Type-Enhancement label.

@kevmoo
Copy link
Member

kevmoo commented Mar 2, 2015

Issue #22607 has been merged into this issue.

@sgjesse
Copy link
Contributor

sgjesse commented Mar 5, 2015

The spec is now a Proposed Standard, https://lists.w3.org/Archives/Public/ietf-http-wg/2015JanMar/0478.html.

The implementation will start out as a package for inclusion into dart:io later.


Set owner to @mkustermann.
Added Started label.

@sgjesse
Copy link
Contributor

sgjesse commented Mar 5, 2015

Issue #22661 has been merged into this issue.


cc @mkustermann.

@sgjesse
Copy link
Contributor

sgjesse commented Mar 5, 2015

Marked this as blocking #22655.

@DartBot
Copy link
Author

DartBot commented Mar 5, 2015

This comment was originally written by r.w.lincol...@gmail.com


Would it be possible for this to be implemented in such a way as to optionally support use with the Chrome sockets API?

https://developer.chrome.com/apps/socket

Similar to the way the CDE folks have done with PicoServer in chrome_net:

https://pub.dartlang.org/packages/chrome_net

@DartBot DartBot added Type-Enhancement library-io area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Mar 5, 2015
This was referenced Jun 3, 2015
@ghost
Copy link

ghost commented Sep 3, 2015

Hello there, any updates?

@kevmoo
Copy link
Member

kevmoo commented Sep 3, 2015

@mkustermann is cranking on it, although in a private repo. @sgjesse or he will be able to give more details.

@ghost
Copy link

ghost commented Sep 4, 2015

Good to know, that no one forget about HTTP/2 impl. Thanks! 😃

@mkustermann
Copy link
Member

We published now a first version of package:http2 and the repository is available under github.com/dart-lang/http2. Please note that this is an alpha version and there are things still missing.

@teodor-pripoae teodor-pripoae mentioned this issue Jan 6, 2016
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
@stevenroose
Copy link

It's been a year, how are things going?

@kevmoo
Copy link
Member

kevmoo commented Nov 15, 2016

CC @kasperl

@kasperl kasperl assigned jakobr-google and unassigned mkustermann Jan 3, 2017
@Reprevise
Copy link

Given http2 has been out for awhile... why is this issue still open? Although Dart's HttpClient should really be atleast using HTTP/2 by now, or given the option to specify the HTTP version.

@kevmoo
Copy link
Member

kevmoo commented Oct 30, 2023

CC @brianquinlan – I agree! I wish we had this out of the box. HTTP3 as well!

@Reprevise
Copy link

The implementation will start out as a package for inclusion into dart:io later.

Still waiting on the inclusion of http2 into dart:io. 😅 Really missing the network logs provided by Flutter's DevTools because I have to use Dio's http2 adapter. It's about time Dart's internal HttpClient got HTTP/2 support.

@brianquinlan
Copy link
Contributor

Developers who need to support server push can use package:http2.

If you don't need server push then you can use package:cronet_http (on Android) and package:cupertino_http (on macOS/iOS), which both support HTTP, HTTP/2, and HTTP/3 over QUIC.

Is there a reason that this is not sufficient?

@Reprevise
Copy link

Is there a reason that this is not sufficient?

Well, Flutter loads it's images over Dart's HttpClient which is, as you know, is HTTP/1 with no option to change it. In addition, using cronet_http alienates users who don't have Google Play Services installed on their device, and having that embedded inflates the APK size by quite a bit. Clearly, http2 is meant to be included in Dart as per the comment above as well.

@brianquinlan
Copy link
Contributor

Is there a reason that this is not sufficient?

Well, Flutter loads it's images over Dart's HttpClient...

package:http_image_provider adapts a package:http Client into an ImageProvider. The documentation for package:http has an example usage.

The same example also shows how to conditionally configure the Client based on the platform.

which is, as you know, is HTTP/1 with no option to change it. In addition, using cronet_http alienates users who don't have Google Play Services installed on their device, and having that embedded inflates the APK size by quite a bit.

Agreed that APK size is an issue for users who can't depend on GPS.

It should be straightforward to create an ImageProvider or package:http Client adapter for package:http2. The later would allow developers to pick the HTTP implementation that they want for their platform (including package:http2).

Our current advice for developers is to use package:http and then choose an appropriate implementation for their platform. Core Dart is unlikely to ever support more recent HTTP versions (such as HTTP/3 over QUIC) because the implementation would result in a significant increase in disk footprint.

@Reprevise
Copy link

Core Dart is unlikely to ever support more recent HTTP versions (such as HTTP/3 over QUIC) because the implementation would result in a significant increase in disk footprint.

I'd be fine with an official package that's just a wrapper over a native HTTP/3 library (via native assets perhaps), that'd work for me. I still think it's a shame that Dart's client will only ever support HTTP/1.1, perhaps greater HTTP/2 adoption will force Dart's hand.

There are some quirky aspects of using http2, like it's not as high-level as the http package is. Also, learned the hard way that http2 doesn't automatically decode gzip responses (nor does it ask for them like Dart's client does). There's an open issue in that package somewhere, though it's unlikely to be addressed.

Overall, I'd love the ability to use HTTP/3 but that doesn't seem like its coming to Dart anytime soon, and this issue is about HTTP/2 implementation in core Dart which also appears very unlikely, though this issue should probably remain open when the adoption inevitably rate climbs. Perhaps, http could support http2, maybe there's already an open issue, not sure.

@brianquinlan brianquinlan added closed-as-intended Closed as the reported issue is expected behavior closed-not-planned Closed as we don't intend to take action on the reported issue labels Feb 8, 2024
@brianquinlan
Copy link
Contributor

Overall, I'd love the ability to use HTTP/3 but that doesn't seem like its coming to Dart anytime soon, and this issue is about HTTP/2 implementation in core Dart which also appears very unlikely, though this issue should probably remain open when the adoption inevitably rate climbs. Perhaps, http could support http2, maybe there's already an open issue, not sure.

package:http provides an abstract Client interface that can support multiple implementations (like the excellent package:fetch_client). Ideally, an implementation of HTTP/2 should be done in terms of that Client and not be in the Dart SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-as-intended Closed as the reported issue is expected behavior closed-not-planned Closed as we don't intend to take action on the reported issue library-io type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

10 participants