You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm sorry to open a new issue if this is actually a dup, but I've not found any solution to my issue for weeks reading all the possibly related issues already submitted, and I feel there's nothing exactly like mine.
I'm using flutter and I encountered a problem when I'm trying to get packages (flutter packages get),flutter upgrade, and anything that has something to do with fetching packages if I'm behind a corporate proxy that needs authentication.
I still can't fetch the packages even if I've set the environment variables as such : http_proxy=http://user%40name:password@hostname:port https_proxy=http://user%40name:password@hostname:port
(n.b. %40 since my username have '@' character)
FYI, I can access pub.dartlang.org just fine in the browser,
I could also access every link that was suggested in another related issues like mine.
Try to write a small a small program using dart:io and get that to work. If you can't get the following to work then there is a problem with how your HTTP proxy is configured, how you are supplying credentials, or how dart:io handles %40 in it's encoding, or how your proxy handles %40 in it's code (not unlikely)..
import'dart:io';
import'dart:convert';
Future<void> main() async {
final client =HttpClient();
final uri =Uri.parse('https://pub.dartlang.org/api/packages/test');
final req =await client.getUrl(uri);
final res =await req.close();
final raw =await res.toList().then((l) => l.expand((i) => i).toList());
final out = json.fuse(utf8).decode(raw) asMap<String, dynamic>;
final ver = out['latest']['version'];
print('Latest version of test package is $ver');
client.close();
}
I'm not sure encoding with %40 will work (I have no idea).. you'll likely have to debug dart:io for this to work.
I'm not sure how much we can help you debug specific cases like this, as it could be so many things...
From the stack trace it looks as though your proxy might complain about missing authentication...
Unhandled exception:
HttpException: Proxy failed to establish tunnel (407 Proxy Authentication Required), uri = //pub.dartlang.org:443
Other things like apt, browser works fine with the proxy but flutter worn't. Note: my proxy credentials have one space and one @ that I replace with %20 and %40 .
Hello,
I'm sorry to open a new issue if this is actually a dup, but I've not found any solution to my issue for weeks reading all the possibly related issues already submitted, and I feel there's nothing exactly like mine.
I'm using flutter and I encountered a problem when I'm trying to get packages (
flutter packages get
),flutter upgrade
, and anything that has something to do with fetching packages if I'm behind a corporate proxy that needs authentication.I still can't fetch the packages even if I've set the environment variables as such :
http_proxy=http://user%40name:password@hostname:port
https_proxy=http://user%40name:password@hostname:port
(n.b. %40 since my username have '@' character)
FYI, I can access pub.dartlang.org just fine in the browser,
I could also access every link that was suggested in another related issues like mine.
This is my log from flutter run --verbose :
My
flutter doctor
result is this :Is the only way I could work on this is by using this solution below?
https://stackoverflow.com/questions/16808883/dart-pub-fail-behind-a-proxy-is-there-a-way-to-install-the-packages-manually
It's pretty bothersome if I need to remote my computer at home everytime I'm updating my dependencies, especially when I still have another dependency issues.
Thank you before, please tell me if you need more information on this.
The text was updated successfully, but these errors were encountered: