Issue 5454 in dart: Allow pub to use an HTTP proxy

1,998 views
Skip to first unread message

da...@googlecode.com

unread,
Sep 25, 2012, 6:42:51 PM9/25/12
to bu...@dartlang.org
Status: Triaged
Owner: ----
Labels: Type-Enhancement Priority-Medium Area-Pub

New issue 5454 by seth...@google.com: Allow pub to use an HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

Command line apps that access HTTP resources, like pub, should allow for
proxy configurations. Proxies are used in corporate environments.

da...@googlecode.com

unread,
Sep 26, 2012, 4:51:36 AM9/26/12
to bu...@dartlang.org
Updates:
Blockedon: dart:5468

Comment #1 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Pub is written in Dart and uses HttpClient from dart:io to fetch its
resources. Therefore this requires HttpClient to support a proxy
configuration.

da...@googlecode.com

unread,
Oct 4, 2012, 1:46:47 PM10/4/12
to bu...@dartlang.org
Updates:
Labels: Milestone-Later

Comment #2 on issue 5454 by rnys...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

(No comment was entered for this change.)

da...@googlecode.com

unread,
Nov 6, 2012, 5:42:55 AM11/6/12
to bu...@dartlang.org

Comment #3 on issue 5454 by laurent....@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Not having it prevents corporate users from testing dart with the todomvc
example. See error logs:

Running pub install ...
Pub install fail, Resolving dependencies...
SocketIOException: Connection failed (OS Error: A connection attempt failed
because the connected party did not properly respond after a period of
time, or established connection failed because connected host has failed to
respond.
, errno = 10060)

/todomvc/build.dart
Failed with error code 255
Unable to open file:
C:/Programs/dart/samples/todomvc/packages/web_components/component_build.dart'file:///C:/Programs/dart/samples/todomvc/build.dart':
Error: line 7 pos 1: library handler failed
import 'package:web_components/component_build.dart';
^



da...@googlecode.com

unread,
Nov 6, 2012, 10:49:31 AM11/6/12
to bu...@dartlang.org

Comment #4 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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.

da...@googlecode.com

unread,
Nov 6, 2012, 2:34:03 PM11/6/12
to bu...@dartlang.org

Comment #5 on issue 5454 by laurent....@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Thanks @sgjesse
In fact, most corporate environments do require authentication.

da...@googlecode.com

unread,
Jan 4, 2013, 9:51:14 AM1/4/13
to bu...@dartlang.org

Comment #6 on issue 5454 by petr.jir...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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.

da...@googlecode.com

unread,
Jan 16, 2013, 3:28:12 AM1/16/13
to bu...@dartlang.org

Comment #7 on issue 5454 by geert.wl...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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? :)

da...@googlecode.com

unread,
Jan 16, 2013, 3:35:55 AM1/16/13
to bu...@dartlang.org

Comment #8 on issue 5454 by seth...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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.

da...@googlecode.com

unread,
Jan 16, 2013, 4:09:58 AM1/16/13
to bu...@dartlang.org

Comment #9 on issue 5454 by geert.wl...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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

da...@googlecode.com

unread,
Jan 17, 2013, 2:25:16 AM1/17/13
to bu...@dartlang.org

Comment #10 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Geert,

I was wondering whether the proxy support in dart:io will work for you.
Could you please try to run the script below with line 7 changed to your
proxy configuration.?

import 'dart:io';
import 'dart:uri';

main() {
HttpClient client = new HttpClient();

client.findProxy = (Uri uri) => "PROXY localhost:8080;";

HttpClientConnection conn =
client.getUrl(new Uri.fromString("http://pub.dartlang.org"));
conn.onResponse = (HttpClientResponse response) {
response.inputStream.onData = () =>
print(new String.fromCharCodes(response.inputStream.read()));
response.inputStream.onClosed = () {
client.shutdown();
};
};
}

Regards,
Søren

da...@googlecode.com

unread,
Jan 17, 2013, 5:47:34 AM1/17/13
to bu...@dartlang.org

Comment #11 on issue 5454 by geert.wl...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

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"

da...@googlecode.com

unread,
Jan 17, 2013, 6:51:05 AM1/17/13
to bu...@dartlang.org

Comment #12 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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)
{
return "PROXY proxy.example.com:8080; DIRECT";
}

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
pacparser.init()
pacparser.parse_pac_file('wpad.dat')
print pacparser.find_proxy('http://pub.dartlang.org', 'pub.dartlang.org')
pacparser.cleanup()

Regards,
Søren

da...@googlecode.com

unread,
Jan 23, 2013, 5:13:31 AM1/23/13
to bu...@dartlang.org

Comment #13 on issue 5454 by adamles...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Hi, the workaround i'm using is:
1) configure http_proxy
2) make sure that curl works fine (curl http://pub.dartlang.org)
3) change dart-sdk\util\pub\http.dart
replace
/// The HTTP client to use for all HTTP requests.
final httpClient = new PubHttpClient();

with
final httpClient = new PubHttpClient(new CurlClient());

Do you have a simpler one?

da...@googlecode.com

unread,
Jan 23, 2013, 5:25:44 AM1/23/13
to bu...@dartlang.org

Comment #14 on issue 5454 by geert.wl...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

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?

da...@googlecode.com

unread,
Jan 23, 2013, 5:30:35 AM1/23/13
to bu...@dartlang.org

Comment #15 on issue 5454 by adamles...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

I cannot agree more, this one is a showstopper in corporate environment.

da...@googlecode.com

unread,
Jan 23, 2013, 6:15:38 PM1/23/13
to bu...@dartlang.org

Comment #16 on issue 5454 by empyrean...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

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)

da...@googlecode.com

unread,
Feb 19, 2013, 6:19:20 PM2/19/13
to bu...@dartlang.org

Comment #17 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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 `_inner.findProxy = (Uri uri) => "PROXY ...;`. This resulted in

Got socket error trying to find package "web_ui" at
https://pub.dartlang.org.
OS Error: errno = -12263

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?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
Feb 20, 2013, 3:41:02 AM2/20/13
to bu...@dartlang.org

Comment #18 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

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/

da...@googlecode.com

unread,
Feb 20, 2013, 9:38:41 AM2/20/13
to bu...@dartlang.org

Comment #19 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

The issue reported in #17 is fixed in
https://code.google.com/p/dart/source/detail?r=18759.

da...@googlecode.com

unread,
Feb 20, 2013, 11:53:06 AM2/20/13
to bu...@dartlang.org

Comment #20 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Excellent, thank you!

da...@googlecode.com

unread,
Feb 20, 2013, 1:52:06 PM2/20/13
to bu...@dartlang.org

Comment #21 on issue 5454 by egon.ni...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

one more vote. this is turning out to be a show stopper in our workplace as
well

da...@googlecode.com

unread,
Feb 23, 2013, 2:07:16 PM2/23/13
to bu...@dartlang.org

Comment #22 on issue 5454 by integrag...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

#10 seems to work for me in a console app. What code do I need to modify in
order to make pub find the proxy using this approach?

da...@googlecode.com

unread,
Feb 23, 2013, 3:15:09 PM2/23/13
to bu...@dartlang.org

Comment #23 on issue 5454 by dgr...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Can you guys try the latest bleeding_edge? the fix in #17 will be in
Monday's integration build.

da...@googlecode.com

unread,
Feb 25, 2013, 4:19:21 PM2/25/13
to bu...@dartlang.org

Comment #24 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

OK, reapplied my changes from #17 with SDK 0.4.0.0_r18915; the OS Error is
gone, however now pub install gives me `HTTP error 503: Service
Unavailable` instead.

da...@googlecode.com

unread,
Feb 26, 2013, 5:31:37 AM2/26/13
to bu...@dartlang.org

Comment #25 on issue 5454 by egon.ni...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Since the old workaround with CurlClient is no longer usable, I've tried to
use

_inner.findProxy = (Uri uri) => "PROXY proxyhost:port;";

But since our proxy requires authentication I still can't get it to work.
I've tried with

_inner.findProxy = (Uri uri) => "PROXY username:password@proxyhost:port;";

but this isn't valid either.

Any other ideas for getting this to work?

da...@googlecode.com

unread,
Feb 26, 2013, 5:42:18 AM2/26/13
to bu...@dartlang.org

Comment #26 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Dart does not support proxies which requires authentication. Currently the
proxy support in Dart is based providing the proxy configuration using the
same syntax as Proxy Auto Configuration scripts in the browser uses.
However that does not support authenticated proxies
(http://serverfault.com/questions/394130/how-to-automatically-configure-username-password-with-proxy-pac-file).

To support this we should probably make it possible to have either a fixed
configuration (where proxy authentication can be configured) or a dynamic
configuration where findProxy is used to provide proxy configuration on a
per URL basis.

da...@googlecode.com

unread,
Mar 7, 2013, 11:41:50 AM3/7/13
to bu...@dartlang.org

Comment #27 on issue 5454 by empyrean...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

With sdk 0.4.1.0_r19425 on osx 10.7.5, I've copied the same external site
rule from my corporate proxy.pac file into the change in #17. Unfortunately
running pub update results in a HTTP error 500: handshakefailed.

Given the 500, is it possible the problem is just local? My proxy doesn't
require authentication or ssl, but I'm not sure what else to rule out. Or
has anyone else encountered this with the current sdk?

da...@googlecode.com

unread,
Mar 14, 2013, 7:38:09 PM3/14/13
to bu...@dartlang.org

Comment #28 on issue 5454 by rnys...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Issue 8749 has been merged into this issue.

da...@googlecode.com

unread,
Mar 25, 2013, 3:26:50 PM3/25/13
to bu...@dartlang.org

Comment #29 on issue 5454 by ivo.balbaert: Allow pub to use an HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

I would like to give an introductory Dart course in our college, but the
students PC's are on a network that have to connect to the internet via a
proxy server.
So I have to postpone my lessons until this is possible.

Getting the following error message:
22-mrt-2013 14:34:25 Running pub install ...
Pub install failed, [1] Resolving dependencies...
Got socket error trying to find package "web_ui" at
https://pub.dartlang.org.
OS Error: A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection failed
because connected host has failed to respond.
, errno = 10060


Cheers,
Ivo Balbaert

da...@googlecode.com

unread,
Apr 12, 2013, 4:23:35 AM4/12/13
to bu...@dartlang.org

Comment #30 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

With https://code.google.com/p/dart/source/detail?r=21332 the default for
HttpClient is to used the proxy configuration set in the envrionment, see
findProxyFromEnvironment on
http://api.dartlang.org/docs/releases/latest/dart_io/HttpClient.html

The following should then make pub use a proxy server

$ https_proxy=http://localhost:8080 pub install

da...@googlecode.com

unread,
Apr 15, 2013, 7:01:04 PM4/15/13
to bu...@dartlang.org

Comment #31 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Tried that with Dart SDK 0.1.2.0_r21523, got the following

Resolving dependencies...
HTTP error 503: Service Unavailable

Confirmed $https_proxy is set by running `echo $https_proxy`. Verified that
the proxy itself is up at the reported address and port.

da...@googlecode.com

unread,
Apr 16, 2013, 5:28:41 PM4/16/13
to bu...@dartlang.org

Comment #32 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

To follow up on #31, looking at network traffic, pub doesn't try establish
secure connection and performs a GET on package JSON (ie.
https://pub.dartlang.org/packages/web_ui.json)

da...@googlecode.com

unread,
Apr 17, 2013, 10:54:39 AM4/17/13
to bu...@dartlang.org

Comment #33 on issue 5454 by polid...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

I'm using https_proxy and when I try to do pub install i get the below. It
used to time out, so it seems like it's noticing the https_proxy variable,
but still not working. Git, curl, etc all work fine with these environment
variables.


--- Apr 17, 2013 10:52:56 AM Running pub install ... ---
Pub install failed, [69] Resolving dependencies...
HTTP error 501: Not Implemented

da...@googlecode.com

unread,
Apr 17, 2013, 11:20:46 AM4/17/13
to bu...@dartlang.org

Comment #34 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Thanks for the error reports. Would it be possible for you to run the
following telnet command:

$ telnet <proxyhost> <proxyport>
GET http://pub.dartlang.org/ HTTP/1.1
Host: pub.dartlang.org

Remember to send an empty line in the end.

Does this also show a 501/503 status from the proxy? Does it have some
additional error information in the response body?

da...@googlecode.com

unread,
Apr 17, 2013, 11:24:36 AM4/17/13
to bu...@dartlang.org

Comment #35 on issue 5454 by polid...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

#34, that works fine. I think the issue is that my proxy requires CONNECT
for https.

da...@googlecode.com

unread,
Apr 17, 2013, 11:25:36 AM4/17/13
to bu...@dartlang.org

Comment #36 on issue 5454 by polid...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

If I try to do GET https, I get this:


<blockquote id="error">
<p><b>Unsupported Request Method and Protocol</b></p>
</blockquote>

<p>Squid does not support all request methods for all access protocols. For
example, you can not POST a Gopher request.</p>

da...@googlecode.com

unread,
Apr 17, 2013, 12:09:08 PM4/17/13
to bu...@dartlang.org

Comment #37 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Thanks for trying this out. Could it be that the proxy does not support
HTTP/1.1?

Could you please try this (just changing 1.1 to 1.0 in the request)?

$ telnet <proxyhost> <proxyport>
GET http://pub.dartlang.org/ HTTP/1.0
Host: pub.dartlang.org

da...@googlecode.com

unread,
Apr 17, 2013, 12:14:49 PM4/17/13
to bu...@dartlang.org

Comment #38 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

I can confirm both #34 and #37 work on our Squid proxy. I can also confirm
#35; curl'ing package json file issued a CONNECT whereas pub install'ing it
didn't.

da...@googlecode.com

unread,
Apr 17, 2013, 12:29:15 PM4/17/13
to bu...@dartlang.org

Comment #39 on issue 5454 by polid...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

#37 -- GET .. HTTP/1.1 works with http, but neither works with HTTPS. If
pub was using CONNECT for https OR was connecting to the HTTP server, then
I think my environment would work.

da...@googlecode.com

unread,
Apr 17, 2013, 5:27:10 PM4/17/13
to bu...@dartlang.org
Updates:
Owner: sgj...@google.com
Labels: -Milestone-Later Milestone-M5

Comment #40 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Thanks for helping out with this issue.

First of all the Dart proxy support does not implement tunneling using the
CONNECT method. It is on the list for M5. One thing I am still trying to
figure out is how to configure this. As far as I can see programs like curl
and wget needs specific options to set up a tunnel using the CONNECT
method. I would like the proxy support to require as little configuration
as possible for most use cases. Adding configuration options to HttpClient
pust the burden on all users of HttpClient (e.g. pub) to add configuration
options.

One option could be to automatically retry using the CONNECT if a proxy
reports an error like 501/503. The problem with retrying is that requests
with a body are problematic.

Question for dtcaciuc (#38). When using curl to get the JSON file are you
using the curl -p option (together with the -x option) for curl to set up a
tunnel using the CONNECT method? Seems like curl have no environment
variables for configuring use of a tunnel.

da...@googlecode.com

unread,
Apr 17, 2013, 5:36:32 PM4/17/13
to bu...@dartlang.org

Comment #41 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Hm, no, I didn't use any extra options, just `curl <package json address>`.
wget seems to "just work" too. AFAIK, the only two proxy related settings
here are `http_proxy` and `https_proxy` environment variables.

Here is the curl log, if it's of any help. As I mentioned before, we're
using Squid proxy:


bash $ curl -v https://pub.dartlang.org/packages/web_ui.json
* About to connect() to proxy proxy.example.com port 3128 (#0)
* Trying 10.2.0.226...
* connected
* Connected to proxy.example.com (10.2.0.226) port 3128 (#0)
* Establish HTTP proxy tunnel to pub.dartlang.org:443
> CONNECT pub.dartlang.org:443 HTTP/1.1
> Host: pub.dartlang.org:443
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0
> OpenSSL/0.9.8r zlib/1.2.5
> Proxy-Connection: Keep-Alive

< HTTP/1.0 200 Connection established
<
* Proxy replied OK to CONNECT request
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using RC4-SHA
* Server certificate:
* subject: C=US; ST=California; L=Mountain View; O=Google Inc;
CN=*.dartlang.org
* start date: 2012-08-15 12:25:20 GMT
* expire date: 2013-06-07 19:43:27 GMT
* subjectAltName: pub.dartlang.org matched
* issuer: C=US; O=Google Inc; CN=Google Internet Authority
* SSL certificate verify ok.
> GET /packages/web_ui.json HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0
> OpenSSL/0.9.8r zlib/1.2.5
> Host: pub.dartlang.org
> Accept: */*

< HTTP/1.1 200 OK
< Content-Type: application/json
< Vary: Accept-Encoding
< Date: Wed, 17 Apr 2013 21:33:06 GMT
< Server: Google Frontend
< Cache-Control: private
< Transfer-Encoding: chunked
<
* Connection #0 to host proxy.zymeworks.com left intact
{"uploaders":
["jmes...@google.com", "sig...@google.com", "dgr...@google.com", "te...@google.com"], "name": "web_ui", "versions":
["0.2.10", "0.2.10+1", "0.2.10+2", "0.2.11", "0.2.8+5", "0.2.8+6", "0.2.9", "0.3.0", "0.3.0+1", "0.3.0+2", "0.3.1", "0.3.1+1", "0.3.1+2", "0.3.1+3", "0.3.2", "0.3.3", "0.3.3+1", "0.3.3+2", "0.3.3+3", "0.3.3+4", "0.4.0", "0.4.0+1", "0.4.1", "0.4.1+1", "0.4.1+2", "0.4.1+3", "0.4.1+4", "0.4.1+5", "0.4.1+6", "0.4.1+7", "0.4.2", "0.4.2+1", "0.4.2+2", "0.4.2+3", "0.4.2+4", "0.4.2+5", "0.4.3", "0.4.3+1", "0.4.4", "0.4.4+1", "0.4.5", "0.4.6", "0.4.6+1"]}*
Closing connection #0
* SSLv3, TLS alert, Client hello (1):

da...@googlecode.com

unread,
Apr 18, 2013, 10:38:47 AM4/18/13
to bu...@dartlang.org

Comment #42 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

I have now figure out what is going on. curl always uses the CONNECT method
to establish a tunnel when proxying HTTPS requests, e.g. when the
https_proxy environment variable is set. The -p option to curl can be used
to make curl create a tunnel for normal HTTP requests through a proxy when
the http_proxy environment variable is set.

The current implementation in Dart does not support using the CONNECT
method, and uses normal proxy procedure for HTTPS requests. I have tested
this with an Apache server setting where setting "SSLProxyEngine on" makes
this work.

When CONNECT is implemented I will change the proxy handling for HTTPS
requests to use CONNECT by default. Whether there should be a fallback to
the current implementation if CONNECT is not supported by the proxy server
is still to be decided.

Thanks for helping with tracking this down.

I am afraid that pub does not have an option to use HTTP instead of HTTPS.

da...@googlecode.com

unread,
Apr 18, 2013, 10:42:18 AM4/18/13
to bu...@dartlang.org

Comment #43 on issue 5454 by polid...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Thank you #42. That sounds like the right decision. Looking forward to the
fix.

da...@googlecode.com

unread,
Apr 18, 2013, 1:20:40 PM4/18/13
to bu...@dartlang.org

Comment #44 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

For the time being, I ended up doing just that by modifying _defaultUrl in
pub source to point to http rather than https.

Thanks for working on this!

da...@googlecode.com

unread,
Apr 24, 2013, 3:28:59 PM4/24/13
to bu...@dartlang.org

Comment #45 on issue 5454 by integrag...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

dtcac, what class file is _defaultUrl in?

da...@googlecode.com

unread,
Apr 24, 2013, 3:40:21 PM4/24/13
to bu...@dartlang.org

Comment #46 on issue 5454 by dtcac...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

It's a module level constant in `util/pub/hosted_source.dart` in dart SDK

da...@googlecode.com

unread,
Apr 24, 2013, 5:39:07 PM4/24/13
to bu...@dartlang.org

Comment #47 on issue 5454 by integrag...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

Thanks! For some reason changing _defaultUrl to use http instead of https
doesn't work for me. I get the following:

"HttpParserException: Connection closed before full header was received"

Oddly enough, I can get the json content for the dependency version list,
but I cannot get the gz file from pub. However, I can get it through my
browser, which means that my proxy isn't blocking access. This still seems
to be an issue with Pub. Not sure why this hasn't been fixed yet.

da...@googlecode.com

unread,
Apr 25, 2013, 10:27:47 AM4/25/13
to bu...@dartlang.org

Comment #48 on issue 5454 by integrag...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

I got this working by going back to the M2 pub version and applying the
curl hack in #13. So it works through the command line now, but not through
the IDE. Is there a way to make the IDE to the OS environment variable for
the location of the Dart SDK instead of using the version of Pub that is
included in the current SDK?

da...@googlecode.com

unread,
Apr 30, 2013, 3:14:03 AM4/30/13
to bu...@dartlang.org
Updates:
Status: Fixed

Comment #49 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Support for the CONNECT method was added in
https://code.google.com/p/dart/source/detail?r=22119.

The Dart HTTP client will now use the CONNECT method to establish a tunnel
when a proxy is used for HTTP requests.

Running

$ https_proxy=localhost:8080 $DART_SDK/bin/pub install

will use a proxy tunnel for pub HTTPS requests.

da...@googlecode.com

unread,
May 13, 2013, 2:26:21 PM5/13/13
to bu...@dartlang.org

Comment #50 on issue 5454 by amitava....@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

I am very new in dart world.
I have downloaded dart editor but facing this issue every time. Can anyone
help how to get this fix downloaded and use within already existing dart
editor?

da...@googlecode.com

unread,
May 14, 2013, 5:38:09 AM5/14/13
to bu...@dartlang.org

Comment #51 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

If you have a recently downloaded dart SDK then this should all be part of
the SDK.

Are you on a Linux platform? In that case try the following replacing host
and port with you proxy:

https_proxy=<host:port> $DART_SDK/bin/pub install

da...@googlecode.com

unread,
Jun 7, 2013, 3:53:15 AM6/7/13
to bu...@dartlang.org

Comment #52 on issue 5454 by marcus.s...@evonik.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

We face the same errors while behind a corporate proxey with
authetification. From the discussion I can not see any solution provided
for the issue.
Please help and outline the correct proceeding to get the demo applications
running from behind a proxy which requires user and paswsword .
A simple answer for a newbe would do.
Or is Dart not intended for use in corporations ?

da...@googlecode.com

unread,
Jun 7, 2013, 4:30:30 AM6/7/13
to bu...@dartlang.org

Comment #53 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

You should be able to specify the username and password as part of the
proxy URL

$ export https_proxy=username:password@hostname:port

Currently there is no support for asking the user the the password.

da...@googlecode.com

unread,
Jun 24, 2013, 6:49:06 PM6/24/13
to bu...@dartlang.org

da...@googlecode.com

unread,
Nov 22, 2013, 4:37:37 AM11/22/13
to bu...@dartlang.org

Comment #55 on issue 5454 by geert.wl...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

A workaround should not be called a fix and I would not call the Dart IDE
proxy issue fixed until the Dart IDE uses the system's network settings and
also supports "pac" files.

Maybe proxy-vole is the answer?

https://code.google.com/p/proxy-vole/

da...@googlecode.com

unread,
Nov 22, 2013, 6:18:55 AM11/22/13
to bu...@dartlang.org

Comment #56 on issue 5454 by sgj...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

pub and all the other Dart tools are written in Dart. In order to support
proxy auto-config full JavaScript support is needed. We cannot have Dart
HTTP support in the standalone Dart executable rely on running JavaScript.

da...@googlecode.com

unread,
Nov 22, 2013, 6:43:48 AM11/22/13
to bu...@dartlang.org

Comment #57 on issue 5454 by geert.wl...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

Don't like any Eclipse-based IDE's and just noticed Google is building a
web based Dart IDE ... so I'll keep an eye out for that as I am sure that
one won't have rubbish proxy settings problems.

http://beta.slashdot.org/submission/3134783/google-is-building-spark-a-web-based-ide-built-with-dart

da...@googlecode.com

unread,
Dec 16, 2013, 11:15:36 AM12/16/13
to bu...@dartlang.org

Comment #58 on issue 5454 by zaheerab...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

Does Pub only support https_proxy? It seems that the link pub is pulling
packages from is https://pub.dartland.org. Can the user change this to be
http://pub.dartlang.org?

da...@googlecode.com

unread,
Feb 27, 2014, 10:48:09 AM2/27/14
to bu...@dartlang.org

Comment #59 on issue 5454 by moru0...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

man its about time to fix this ..

da...@googlecode.com

unread,
Feb 27, 2014, 11:00:24 AM2/27/14
to bu...@dartlang.org

Comment #60 on issue 5454 by zaheerab...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

I found that putting your http proxy information into the https_proxy
environment variable resolves pub. Most http proxies are configured to also
route https requests.

da...@googlecode.com

unread,
Feb 27, 2014, 11:08:53 AM2/27/14
to bu...@dartlang.org

Comment #61 on issue 5454 by moru0...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

For me none of the workarounds fixes that (win 7):
1) my dartini
-data
@user.home\DartEditor
-vmargs
-d64
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=128m
-Xms256m
-Xmx2000m
-Dhttp.proxyHost=webproxy.XXX-XXX.de
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=webproxy.XXX-XXX.de
-Dhttps.proxyPort=8080

env:
HTTPS_PROXY=webproxy.XXX-XXX.de:8080
HTTP_PROXY=webproxy.XXX-XXX.de:8080

still I can't update and i can't build as I get

--- 17:07:03 build.dart --machine --clean ---
file:/D:/work/DartPlay-master/TableTest/build.dart
build.dart returned error code 254

Unable to open file:
D:\work\DartPlay-master\TableTest\packages\polymer\src\build\linter.dart'package:polymer/builder.dart':
error: line 89 pos 1: library handler failed
import 'src/build/linter.dart';
^
'file:///D:/work/DartPlay-master/TableTest/build.dart': error: line 1 pos
1: library handler failed
import 'package:polymer/builder.dart';
^


--- 17:07:03 build.dart --machine --full ---
file:/D:/work/DartPlay-master/TableTest/build.dart
build.dart returned error code 254

Unable to open file:
D:\work\DartPlay-master\TableTest\packages\polymer\src\build\linter.dart'package:polymer/builder.dart':
error: line 89 pos 1: library handler failed
import 'src/build/linter.dart';
^
'file:///D:/work/DartPlay-master/TableTest/build.dart': error: line 1 pos
1: library handler failed
import 'package:polymer/builder.dart';
^

This is a 100% showstopper for real-world commercial Dart usage.

da...@googlecode.com

unread,
Feb 27, 2014, 2:16:47 PM2/27/14
to bu...@dartlang.org

Comment #62 on issue 5454 by zaheerab...@gmail.com: Allow pub to use an
HTTP proxy
http://code.google.com/p/dart/issues/detail?id=5454

Try keeping your proxy port as 80 in the https_proxy environment variable.

da...@googlecode.com

unread,
Feb 27, 2014, 3:09:07 PM2/27/14
to bu...@dartlang.org

Comment #63 on issue 5454 by moru0...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

I got manual pub update to connect, but it now fails messing up with
windows share names like \\server\home\myname. It seems to expect drive
letters at any given windows path ..

da...@googlecode.com

unread,
Feb 27, 2014, 3:22:11 PM2/27/14
to bu...@dartlang.org
Updates:
Labels: -Area-Pub Area-IO

Comment #64 on issue 5454 by nw...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

I'm reassinging this to Area-IO, since all the HTTP proxy stuff is handled
by dart:io.

da...@googlecode.com

unread,
Mar 3, 2014, 9:39:49 AM3/3/14
to bu...@dartlang.org
Updates:
Labels: -Milestone-M5

Comment #65 on issue 5454 by ajoh...@google.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

Hi moru0111,

Can you provide us with an isolates example of what you are trying to do,
so we can produce it - preferable from command-line and not the editor.
That would be really helpful - I'd really like to find a fix for this!

Thanks!,

- Anders

da...@googlecode.com

unread,
Apr 30, 2014, 12:52:20 PM4/30/14
to bu...@dartlang.org

Comment #66 on issue 5454 by IyadEl...@gmail.com: Allow pub to use an HTTP
proxy
http://code.google.com/p/dart/issues/detail?id=5454

it seems now pub on the command line honors http_proxy and https_proxy env
variables. pub from the eclipse based editor does not. it sounds easy to
restore the proxy preference that existed in the original eclipse rcp
before the customization omitted it. don't understand why this is hard.
Reply all
Reply to author
Forward
0 new messages