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

HttpClient should honor the system configured proxy #50434

Open
brianquinlan opened this issue Nov 10, 2022 · 8 comments
Open

HttpClient should honor the system configured proxy #50434

brianquinlan opened this issue Nov 10, 2022 · 8 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io P3 A lower priority bug or feature request triaged Issue has been triaged by sub team

Comments

@brianquinlan
Copy link
Contributor

This bug corresponds to this Flutter issue:
flutter/flutter#26359

And the reason that this is important is discussed here:
#48056

@brianquinlan brianquinlan added P1 A high priority bug; for example, a single project is unusable or has many test failures area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io library-io-triaged labels Nov 10, 2022
@brianquinlan brianquinlan self-assigned this Nov 10, 2022
@fr-markyan
Copy link

It would be very helpful if HttpClient can respect system configured proxy, especially for enterprise app

@brianquinlan
Copy link
Contributor Author

I've been experimenting with moving Flutter to use package:http.

That would allow the user to use package:cronet_http on Android and package:cupertino_http on iOS, which do honor the system-configured proxy.

We could also solve this issue in HttpClient. This would actually be fairly easy on iOS but harder on Android (AFAIK, the only way would be to make JNI calls to get the proxy configuration).

@brianquinlan
Copy link
Contributor Author

I started a discussing on this in the hackers-framework-🔩 Discussion. So far the feedback is that depending on package:http seems like a bad idea.

@brianquinlan
Copy link
Contributor Author

It looks like there is only one common use case in Flutter where dart:io HttpClient is used: image display through Image.network.

It is very easy to replace this with package:cached_network_image, which uses package:http and can, therefore, be configured to use a native http client.

@a-siva a-siva added triaged Issue has been triaged by sub team and removed library-io-triaged labels Dec 20, 2022
@brianquinlan
Copy link
Contributor Author

I've updated the examples in cupertino_http and cronet_http to use package:cached_network_image.

At this point it should be possible to use those packages to deal with the proxy issue.

@brianquinlan
Copy link
Contributor Author

I wrote a design doc suggesting that we recommend package:http as an HTTP client. Feedback welcome!

@brianquinlan
Copy link
Contributor Author

I presented this at the Dash forum. It's basically asking for feedback for the design doc. There seemed to be consensus so I'm moving forward on it.

@brianquinlan brianquinlan added P3 A lower priority bug or feature request and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Mar 17, 2023
@brianquinlan
Copy link
Contributor Author

There is still work to do in terms of documentation but think that we already have a solution in place.

@lrhn lrhn added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. and removed area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io P3 A lower priority bug or feature request triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

4 participants