Skip to content

Flutter (attach) expects NO_PROXY Environment Variable to be comma separated list on Windows. #62341

@ghost

Description

@rakeshdn commented on Jul 26, 2020, 12:17 AM UTC:

While launching a flutter app from Android Studio , the flutter attach stage failed
with a HttpException complaining about a failure to upgrade to websocket for connection
to Dart observatory url on the loopback address 127.0.0.1
The end result is that flutter inspector,outline and performance tabs remain blank
and hot reload buttons stay disabled.

To get this to work ( unfortunately after wasting two days searching forums and trying many things.. )
I had to change NO_PROXY windows system environment variable value from
127.0.0.1;localhost to
127.0.0.1,localhost.
Windows convention is to separate tokens with semicolons rather than commas.
So this is likely to break other windows applications.

Note that Flutter doctor -v is happy with either comma or semicolon, and does not report any issues.

The root cause of problem could be the hard coded "," in code below (from http_impl.dart)
being new to Flutter and Dart, I am not even sure whether the code below is being used....

static String _findProxyFromEnvironment(
      Uri url, Map<String, String> environment) {
    checkNoProxy(String option) {
      if (option == null) return null;
      Iterator<String> names = option.split(",").map((s) => s.trim()).iterator;

Other related issues: (but not Windows specific)
flutter/flutter#25112
flutter/flutter#16875
flutter/flutter#52096

My tool chain version details below.

Microsoft Windows [Version 10.0.18362.836]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\sesa319166\AndroidStudioProjects\mi_card_flutter>flutter doctor -v
[√] Flutter (Channel @U, v1.17.5, on Microsoft Windows [Version 10.0.18362.836], locale en-GB)
• Flutter version 1.17.5 at C:\flsdk\flutter
• Framework revision 8af6b2f (4 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at C:\Users\sesa319166\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.47.2)
• VS Code at C:\Users\sesa319166\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.10.1

[√] Proxy Configuration
• HTTP_PROXY is set
• NO_PROXY is 127.0.0.1,localhost
• NO_PROXY contains 127.0.0.1
• NO_PROXY contains localhost

[√] Connected device (1 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 8.0.0 (API 26) (emulator)

• No issues found!

This issue was moved by helin24 from flutter/flutter-intellij#4716.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listdependency: dartDart team may need to help us

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions