Skip to content
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

added getProxy #3320

Merged
merged 3 commits into from
Jan 9, 2018
Merged

added getProxy #3320

merged 3 commits into from
Jan 9, 2018

Conversation

mdogadailo
Copy link
Contributor

@mdogadailo mdogadailo commented Oct 24, 2017

If user under proxy and didn't set HTTP_PROXY variable, create-react-app decides that user is offline and try to download packages from mirror, which are not here because you never download them (packages) before.

proxy

This patch adds getProxy function, that checks process.env.https_proxy and if it's undefined, will try to get https-proxy settings from Yarn (actually from npm) config file (.npmrc), if it's not defined yet, well we tried our best or you are offline.

getProxy checks proxy settings from process.env.https_proxy or Yarn (NPM) config (.npmrc)
@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2017

Can we change this to fall back to npm somehow? It feels a bit odd that we use Yarn for reading an npm file.

default value for https-proxy is null, not undefined like in yarn
@mdogadailo
Copy link
Contributor Author

I've updated function to getting details from npm.

@gaearon gaearon added this to the 1.0.18 milestone Jan 9, 2018
@gaearon gaearon merged commit 3a0b836 into facebook:master Jan 9, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 9, 2018

Seems okay to me, thanks.

@gaearon gaearon mentioned this pull request Jan 15, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 15, 2018

This is out! Please let us know if something doesn’t quite work.
https://github.com/facebookincubator/create-react-app/releases/tag/v1.1.0

Pavek pushed a commit to Pavek/create-react-app that referenced this pull request Jul 10, 2018
* added getProxy

getProxy checks proxy settings from process.env.https_proxy or Yarn (NPM) config (.npmrc)

* changed yarn for npm to get https-proxy 

default value for https-proxy is null, not undefined like in yarn
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants