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

Allow use of proxy settings? #26

Closed
poshaughnessy opened this issue Jan 18, 2018 · 4 comments
Closed

Allow use of proxy settings? #26

poshaughnessy opened this issue Jan 18, 2018 · 4 comments

Comments

@poshaughnessy
Copy link
Contributor

Hi Rich. I'm following the Sapper Getting Started Guide and running: degit sveltejs/sapper-template my-app.

But I'm here on the office network behind a proxy - and the command hangs and eventually says "could not download".

I have my proxy settings set OK in my environment variables (http_proxy, https_proxy). I've checked that in the same terminal, I'm able to download the same URL OK using wget.

Would you be OK with adding the ability to deal with proxies?

I've previously done this using something like this:

import httpsProxyAgent from 'https-proxy-agent';

const httpsProxy = process.env.https_proxy;
let fetchOptions = null;

if (httpsProxy) {
    // Log: 'Using proxy server': httpsProxy
    fetchOptions = {agent: new httpsProxyAgent(httpsProxy)};
}

fetch(fooBarURL, fetchOptions)

If you'd be happy with the same approach - using https-proxy-agent? - I could write a PR if you like?

@Rich-Harris
Copy link
Owner

Yes please, a PR would be great! Thank you

@Rich-Harris
Copy link
Owner

Long overdue, but I've finally merged #27 and released 2.3.0. Thanks!

@poshaughnessy
Copy link
Contributor Author

Cool, cheers Rich! @YogliB sorry I missed your comment on the PR from ages ago!

@dainiel
Copy link

dainiel commented Feb 29, 2020

When will 2.3.0 be released? Don't tell me it is 2022.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants