This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Apply Chromium proxies to env vars for apm#898
Merged
Conversation
winstliu
reviewed
Jan 12, 2017
lib/package-manager.coffee
Outdated
| schema? and (schema.type isnt 'any') | ||
|
|
||
| setProxyServers: (callback) => | ||
| callback() if atom.config.get('core.useProxySettingsWhenCallingApm') isnt true |
Contributor
There was a problem hiding this comment.
callback() unless atom.config.get('core.useProxySettingsWhenCallingApm')seems cleaner.
Contributor
|
Also, this looks like it only gets used with |
Contributor
Author
|
I originally had it in runCommand but the problem is that runCommand immediately passed back a BufferedProcess object that things attach to - this being async it couldn't do that immediately. Breaks everywhere. |
b1dd1e8 to
e37accd
Compare
e37accd to
6e310d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Chromium does a good job at reading system proxy settings which means a lot of what Atom needs to do goes through the correct proxies.
The apm command line being a regular node app and not an Electron/Chromium app does not read or have access to these proxy settings and so fails when trying to connect if you are using a proxy.
This change determines what http and https proxy servers to use based on Chromium's session.resolveProxy call with atom.io and then sets the http_proxy and https_proxy environment variables that apm then uses.
Alternate Designs
Alternative designs include;
Benefits
People behind proxy servers can use apm with no effort.
Possible Drawbacks
Users with manually set http_proxy and https_proxy environment variables will find we override their preferences. They can switch off the auto-detect proxy in settings.