Network Connection Proxies in Dart Editor

喜欢而已 提交于 2019-12-17 21:11:56

问题


Eclipse has a "Network Connections" page in its preferences that allows one to use proxies for network connections, so if I am behind a firewall I can use these connections. I don't see any such option in the Dart Editor. So, while I am at work, I cannot update from the network because of this. I can set the proxy in a browser, but not in Dart Editor. With a direct connection to an ISP, everything is okay, but not from an internal network.

Is there some way to fix this issue? If there is another way to allow the Dart Editor to connect to a network proxy I would be pleased.


回答1:


You have to set environment variables

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

If your proxy needs authentication, the setup will look more like the following:

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

DartEditor is no more

To enable Dart Editor to check for updates, add the following to the DartEditor.ini file:

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

If you need a user name and password for authentication, add:

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

See also https://github.com/dart-lang/sdk/issues/24080



来源:https://stackoverflow.com/questions/24021315/network-connection-proxies-in-dart-editor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!