-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow pub to use an HTTP proxy #5454
Comments
Pub is written in Dart and uses HttpClient from dart:io to fetch its resources. Therefore this requires HttpClient to support a proxy configuration. Marked this as being blocked by #5468. |
Added this to the Later milestone. |
This comment was originally written by laurent.ploi...@gmail.com Not having it prevents corporate users from testing dart with the todomvc example. See error logs: Running pub install ... /todomvc/build.dart |
The HttpClient have support for HTTP proxies as long as they do not require authentication and should not tunnel HTTPS connections, See http://code.google.com/p/dart/issues/detail?id=5468 and HttpClinet.findProxy (http://api.dartlang.org/docs/bleeding_edge/dart_io/HttpClient.html#findProxy=) for details. |
This comment was originally written by laurent....@gmail.com Thanks @sgjesse |
This comment was originally written by petr.jiricka...@gmail.com Until HttpClient supports authentication, it would be useful to at least expose support for non-authenticated proxies in pub, and authentication can be added later. |
This comment was originally written by geert.wl.clae...@gmail.com Since this issue was already raised in September I am a bit baffled as to why it hasn't been given a higher priority then "Milestone: later"? I understand that there is a lot of other studd to deal with but this surely doesn't look good as Dart aims to be the solution for large/complex web apps ... and who would be interrested in something like that I wonder? :) |
Hi Geert, I understand your concerns, and you're right... there's a lot of stuff to deal with when implementing a whole new platform. Our prioritization is influenced in part by developer demand. A good way to affect this is to star issues, which is a way to vote for them. Another way to affect change is to advocate for issues on the mailing list, to drum up support for the issues. What also helps is detailing the use cases that are driving the issue. It really helps for us to understand what this is blocking (e.g. is your company or business trying to use Dart but is blocked by issue XX ?) Thanks very much for the feedback. We do listen, it really does help. |
This comment was originally written by geert.wl.clae...@gmail.com No worries Seth, as I said, I perfectly understand that this is not the only issue the Dart team has to deal with. It just that its kinda of a dealbreaker at the moment for those who are behind a corporate proxy that requires authentication and want to put together a nice Dart prototype app (btw, I love the Dart Widget stuff Kevin Moore is putting together). From how people are voting on StackOverflow I have a feeling not many are behind a proxy. Anyhow, I (as you know, since you replied to me there as well) came here via: http://stackoverflow.com/questions/14316430/dart-pub-update-failed |
Geert, I was wondering whether the proxy support in dart:io will work for you. import 'dart:io'; main() { client.findProxy = (Uri uri) => "PROXY localhost:8080;"; HttpClientConnection conn = Regards, |
This comment was originally written by geert.wl.cla...@gmail.com Hi Søren, Since our connection goes via an automatic configuration script (.pac) I tried replacing the proxy in line 7 with the Address to the .pac but got a "java.net.ConnectException: Connecrtion Refused: connect" |
Hi Geert We cannot support automatic configuration script (.pac) directly in Dart. A .pac is a JavaScript script intended for running in a browser. When a .pac script is used the .pac function FindProxyForURL is called and the returned string is then interpreted by the browser, e.g.: function FindProxyForURL(url, host) The string returned by HttpClient.findProxy callback uses the same format as .pac scripts. There are several standalone .pac evaluators out there, one is https://code.google.com/p/pacparser/. If you use that with the following Python script you should get the string to be used in line 7. import pacparser Regards, |
This comment was originally written by adamlesia...@gmail.com Hi, the workaround i'm using is:
with Do you have a simpler one? |
This comment was originally written by geert.wl....@gmail.com I would prefer for the editor to simply use the System Proxy Settings just like Chrome/Firefox etc does. This issue seems to be linked to issue #5455 which is marked as accepted for the upcoming M3 so shouldn't the Milestone for this issue also be M3? |
This comment was originally written by adamlesi...@gmail.com I cannot agree more, this one is a showstopper in corporate environment. |
This comment was originally written by empyreanst...@gmail.com The workaround in #13 is great, thanks! A caveat on OS X Lion however: After editing html.dart, I tried to test it using $ launchctl setenv http_proxy http://my.corporate.proxy and the Dart Editor still failed to connect. This was without restarting Dart Editor or trying any other troubleshooting though, so this failure isn't definitive. Regardless, to me lack of proxy support in the Dart Editor is not important since the command line tool works: after exporting http_proxy in my shell, running ../project_dir $ path/to/dart-sdk/bin/pub update worked perfectly. If I may share an opinion, this workaround seems acceptable for corporate environments, especially when compared to my previous approach (downloading each dependency by hand to ~/.pub_cache) |
This comment was originally written by dtcac...@gmail.com Since CurlClient is not available in trunk anymore, I recently tried to apply #10 globally to http://code.google.com/p/dart/source/browse/trunk/dart/pkg/http/lib/src/io_client.dart#21 by adding Got socket error trying to find package "web_ui" at https://pub.dartlang.org. which according to search means "SSL received a record that exceeded the maximum permissible length." Would it be a problem in Dart SSL implementation or am I doing this wrong? |
This is a bug in the HTTP proxy implementation. The problem is that the Dart code tries to make a secure connection to the proxy server when the destination URL has scheme HTTPS. Proposed fix for this in https://codereview.chromium.org/12314007/ |
The issue reported in #17 is fixed in https://code.google.com/p/dart/source/detail?r=18759. |
Command line apps that access HTTP resources, like pub, should allow for proxy configurations. Proxies are used in corporate environments.
The text was updated successfully, but these errors were encountered: