Skip to content

Could pub tool support system proxy setting? #24080

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

Closed
taozuhong opened this issue Aug 14, 2015 · 5 comments
Closed

Could pub tool support system proxy setting? #24080

taozuhong opened this issue Aug 14, 2015 · 5 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io type-enhancement A request for a change that isn't a bug

Comments

@taozuhong
Copy link

I have set the proxy for my machine, but dart can't read it, could pub tool support system proxy setting?

image

''when run the pub tool (set proxy by manual),it will return the result as follow pictures:''
image

image

@taozuhong taozuhong changed the title Pub tool could support system proxy setting? Could pub tool support system proxy setting? Aug 14, 2015
@zoechi
Copy link
Contributor

zoechi commented Aug 14, 2015

@taozuhong
Copy link
Author

I know and have used the environment variables HTTP_PROXY/HTTPS_PROXY,but system setting are more flexable, so I hope pub command tool can support it .

@kevmoo
Copy link
Member

kevmoo commented Aug 18, 2015

This issue was moved to dart-lang/pub#1317

@kevmoo kevmoo closed this as completed Aug 18, 2015
@nex3
Copy link
Member

nex3 commented Aug 18, 2015

Pub doesn't explicitly deal with any network configuration at all. This is an issue for dart:io.

@nex3 nex3 reopened this Aug 18, 2015
@nex3 nex3 added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels Aug 18, 2015
@sgjesse
Copy link
Contributor

sgjesse commented Aug 19, 2015

For more information see #5454 which have a long discussion on proxy configuration, here is a copy of one of the comments on supporting automatic proxy configuration:

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()

@sgjesse sgjesse closed this as completed Aug 19, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants