【问题标题】:Network Connection Proxies in Dart EditorDart 编辑器中的网络连接代理
【发布时间】:2014-06-03 17:23:29
【问题描述】:

Eclipse 在其首选项中有一个“网络连接”页面,允许使用代理进行网络连接,所以如果我在防火墙后面,我可以使用这些连接。我在 Dart 编辑器中看不到任何此类选项。因此,当我在工作时,因此无法从网络更新。我可以在浏览器中设置代理,但不能在 Dart 编辑器中设置。通过直接连接到 ISP,一切正常,但不是来自内部网络。

有没有办法解决这个问题?如果有其他方法可以让 Dart 编辑器连接到网络代理,我会很高兴。

【问题讨论】:

    标签: dart dart-editor


    【解决方案1】:

    你必须设置环境变量

    https://www.dartlang.org/tools/editor/troubleshoot.html#pub-get-firewall

    http_proxy=http://<yourproxy>.<yourdomain>.com:9090/
    https_proxy=https://<yourproxy>.<yourdomain>.com:9090/
    no_proxy=localhost,127.0.0.0/8
    

    如果您的代理需要身份验证,则设置将类似于以下内容:

    http_proxy=http://<username>:<password>@<yourproxy>.<yourdomain>.com:9090/
    https_proxy=https://<username>:<password>@<yourproxy>.<yourdomain>.com:9090/
    

    DartEditor 已不复存在

    要使 Dart 编辑器能够检查更新,请将以下内容添加到 DartEditor.ini 文件中:

    -Dhttp.proxyHost=<yourproxy>.<yourdomain>.com
    -Dhttp.proxyPort=9090
    -Dhttps.proxyHost=<yourproxy>.<yourdomain>.com
    -Dhttps.proxyPort=9090
    

    如果需要用户名和密码进行认证,添加:

    -Dhttp.proxyUser=<username>
    -Dhttp.proxyPassword=<passwordstring>
    -Dhttps.proxyUser=<username>
    -Dhttps.proxyPassword=<passwordstring>
    

    另见https://github.com/dart-lang/sdk/issues/24080

    【讨论】:

    • 如何设置环境变量。我知道如何设置 Windows 环境变量,但如果引用是这样的话。我试过了,但没有任何反应。
    • 我好像错过了你的评论。修改环境变量后需要重启应用程序才能生效。当您从命令提示符启动应用程序时,您还需要关闭并重新打开命令提示符。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多