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

Proxy settings #55

Closed
Romakita opened this issue Jun 1, 2017 · 8 comments · Fixed by #157
Closed

Proxy settings #55

Romakita opened this issue Jun 1, 2017 · 8 comments · Fixed by #157
Projects

Comments

@Romakita
Copy link

Romakita commented Jun 1, 2017

Hi @jasongin ,

Actually, I have a problem to add a node.js version. Here my error:

nvs add v7
Failed to download index: https://nodejs.org/dist/index.json
getaddrinfo EAI_AGAIN nodejs.org:443

I think the problem is the proxy settings. But I didn't seen a proxy configuration in your documentation.
I already configured the "proxy", "http_proxy" env but I doesn't work.

Have you an idea ?

Thanks for your work ;)
See you

@jasongin
Copy link
Owner

jasongin commented Jun 1, 2017

NVS doesn't currently support proxy settings. I think that would be a good thing to add.

Node packages (including npm) that use the popular request package automatically respect the HTTP_PROXY & HTTPS_PROXY environment variables. But NVS doesn't use request because that package has a lot of dependencies, and NVS should not require an npm install.

I'm adding this to the backlog.

@jasongin jasongin added this to Up Next in Backlog Jun 1, 2017
@wangzishi
Copy link

The proxy settings are very useful for users in China.

@vickylance
Copy link

@jasongin Any updates on adding the proxy settings?
Because most of us a behind a corporate proxy and getting a CR ticket raised to white list a URL is not a feasible solution at all. It has to go through a lot of security violation checks and it takes months before it can be implemented. And most likely it will be rejected. So it would be very helpful if the proxy options are added soon.

@pedroneil
Copy link

The nvs solution doesn't seem to use vsts npm auth

A very crude example using a user's current proxy setttings and using the .Net WebClient to download through a proxy

Download the archive using PowerShell WebClient using user's Proxy Credentials

$wc = New-Object System.Net.WebClient;
$wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy;
$wc.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials;
$wc.DownloadFile("$bootstrapNodeUri","$bootstrapNodeArchivePath");

If you use the npm config get http-proxy or get https-proxy, you could build a PScredential and pass this to -ProxyCredential parameter on Invoke-WebRequest

$secpasswd = ConvertTo-SecureString "PlainTextPasswordFromNPMconfig" -AsPlainText -Force
$proxyCreds = New-Object System.Management.Automation.PSCredential ("$PlainTextUserNameFromNPMconfig", $secpasswd)

@Fed29
Copy link

Fed29 commented Oct 25, 2018

+1 for proxy setting

jasongin pushed a commit that referenced this issue Jul 17, 2020
Support sending request through proxy set in http_proxy/https_proxy
Fixes #55
@jasongin jasongin moved this from Up Next to Completed in Backlog Jul 20, 2020
@garberfc
Copy link

+2 for proxy setting!

@jetjo
Copy link

jetjo commented Oct 10, 2022

不能使用windows中配置的代理,放弃了。

@vickylance
Copy link

@garberfc @yangbing007 did you both check this PR? #157

its already merged

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

Successfully merging a pull request may close this issue.

8 participants