Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Issue 11066041: Add support for HTTP proxy in the HTTP client (Closed)

Created:
8 years, 2 months ago by Søren Gjesse
Modified:
8 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add support for HTTP proxy in the HTTP client An HttpClient instance now has the property findProxy. This property can be set to a function which can return the proxy configuration encoded in a string in the same format as is used by browser PAC (proxy auto-config) scripts. Currently only the first proxy in the list will be used. I will address trying multiple proxies in a separate CL. Also fixed a HTTP input stream bug revealed by the tests. If an input stream from either a HttpRequest or HttpClientResponse object is retreived after all data in the body has been received the HTTP input stream would call the onClosed callback. R=ajohnsen@google.com BUG=dart:5468 TEST=tests/standalone/io/http_proxy_test.dart Committed: https://code.google.com/p/dart/source/detail?r=13348

Patch Set 1 #

Patch Set 2 : Minor fixes #

Total comments: 13

Patch Set 3 : Addressed review comments from ajohnsen@ #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+439 lines, -22 lines) Patch
M runtime/bin/http.dart View 1 1 chunk +23 lines, -0 lines 0 comments Download
M runtime/bin/http_impl.dart View 1 2 17 chunks +117 lines, -22 lines 8 comments Download
A tests/standalone/io/http_proxy_test.dart View 1 2 1 chunk +299 lines, -0 lines 6 comments Download

Messages

Total messages: 6 (0 generated)
Søren Gjesse
8 years, 2 months ago (2012-10-05 12:30:37 UTC) #1
Anders Johnsen
LGTM. Very nice. Maybe we should create a sample somewhere, with the ProxyServer you have ...
8 years, 2 months ago (2012-10-08 11:05:25 UTC) #2
Søren Gjesse
https://codereview.chromium.org/11066041/diff/3001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): https://codereview.chromium.org/11066041/diff/3001/runtime/bin/http_impl.dart#newcode1995 runtime/bin/http_impl.dart:1995: int port = int.parse(proxy.substring(colon + 1).trim()); On 2012/10/08 11:05:25, ...
8 years, 2 months ago (2012-10-08 12:17:30 UTC) #3
Anders Johnsen
https://codereview.chromium.org/11066041/diff/3001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): https://codereview.chromium.org/11066041/diff/3001/runtime/bin/http_impl.dart#newcode2130 runtime/bin/http_impl.dart:2130: // TODO(sgjesse): Keep a map of these as normally ...
8 years, 2 months ago (2012-10-08 12:27:29 UTC) #4
Mads Ager (google)
DBC https://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): https://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart#newcode1979 runtime/bin/http_impl.dart:1979: _ProxyConfiguration(String configuration) : proxies = new List<_Proxy>() { ...
8 years, 2 months ago (2012-10-08 16:59:39 UTC) #5
Søren Gjesse
8 years, 2 months ago (2012-10-09 14:05:22 UTC) #6
DBC comments addressed in https://codereview.chromium.org/11098018.

http://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart
File runtime/bin/http_impl.dart (right):

http://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart#...
runtime/bin/http_impl.dart:1979: _ProxyConfiguration(String configuration) :
proxies = new List<_Proxy>() {
On 2012/10/08 16:59:39, Mads Ager wrote:
> Funky indentation.

Done.

http://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart#...
runtime/bin/http_impl.dart:2013: const _ProxyConfiguration.direct()
On 2012/10/08 16:59:39, Mads Ager wrote:
> Maybe add a space between the constructors.

Done.

http://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart#...
runtime/bin/http_impl.dart:2180: !proxyConfiguration.proxies[0].direct);
On 2012/10/08 16:59:39, Mads Ager wrote:
> Just !proxy.direct?

Already fixed.

http://codereview.chromium.org/11066041/diff/8001/runtime/bin/http_impl.dart#...
runtime/bin/http_impl.dart:2188: !proxyConfiguration.proxies[0].direct));
On 2012/10/08 16:59:39, Mads Ager wrote:
> !proxy.direct.

Already fixed.

http://codereview.chromium.org/11066041/diff/8001/tests/standalone/io/http_pr...
File tests/standalone/io/http_proxy_test.dart (right):

http://codereview.chromium.org/11066041/diff/8001/tests/standalone/io/http_pr...
tests/standalone/io/http_proxy_test.dart:16: server.listen("127.0.0.1", 0, 5);
On 2012/10/08 16:59:39, Mads Ager wrote:
> Maybe leave out the backlog parameter and just use the default one (which is
> higher)?

Done.

http://codereview.chromium.org/11066041/diff/8001/tests/standalone/io/http_pr...
tests/standalone/io/http_proxy_test.dart:18: (HttpRequest request, HttpResponse
response) {
On 2012/10/08 16:59:39, Mads Ager wrote:
> Funky indentation. See the
> 
>    if (...) {
> } else {
> }
> 
> below.

Done.

http://codereview.chromium.org/11066041/diff/8001/tests/standalone/io/http_pr...
tests/standalone/io/http_proxy_test.dart:63: server.listen("127.0.0.1", 0, 5);
On 2012/10/08 16:59:39, Mads Ager wrote:
> Ditto for the backlog param?

Done.

Powered by Google App Engine
This is Rietveld 408576698