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 env settings not respected in download.js #5

Closed
raleik-pl opened this issue Oct 25, 2019 · 11 comments
Closed

proxy env settings not respected in download.js #5

raleik-pl opened this issue Oct 25, 2019 · 11 comments

Comments

@raleik-pl
Copy link

raleik-pl commented Oct 25, 2019

The download.js script does not care about proxy env variables being set. Therefore it fails to download if the system is behind a proxy.

`yarn add vscode-ripgrep
yarn add v1.19.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info There appears to be trouble with your network connection. Retrying...
error C:\docker\theia-java\node_modules\vscode-ripgrep: Command failed.
Exit code: 1
Command: node ./lib/postinstall.js
Arguments:
Directory: C:\docker\theia-java\node_modules\vscode-ripgrep
Output:
Finding release for v11.0.1-2
GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v11.0.1-2
events.js:167
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 140.82.118.5:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
Emitted 'error' event at:
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.`

The solution would be to add host and port in https.get opts object, and to use -Proxy option for windows.

@chongchai
Copy link

I also have the problem to download behind proxy

@Niklas-Dahlquist
Copy link

Same problem, please fix...

@pillsilly
Copy link

I'm working on this.

@lamontu
Copy link

lamontu commented Dec 4, 2019

I'm working on this.

Have you committed your solution to vscode master?

@mostafaeweda
Copy link

Is this fixed yet? (I'm running into it)

@Niklas-Dahlquist
Copy link

Who can merge Emmanuels solution to this issue?

@LeuisKen
Copy link

LeuisKen commented Apr 3, 2020

Please, we want someone who can make this happen faster.

@kappelian
Copy link

@roblourens

Any updates on when you can merge this fix in?

roblourens added a commit that referenced this issue Jun 7, 2020
Fixing Issue #5 : proxy settings not used
@slhultgren
Copy link

This issue is back again in v1.11.2 if you are using credentials in HTTP_PROXY/HTTPS_PROXY on windows.

It seems the "user:password" credentials are ignored in the proxy URL for Invoke-Webrequest command when using the "-Proxy" parameter.
cb01282#diff-12d45781f0795c69838b6657fe7fc20701665270bf1c38d4777c6140ea0f72beR44-R46

This means that we still fail with to download since we are not being authenticated.

@fgreinacher
Copy link
Contributor

This issue is back again in v1.11.2 if you are using credentials in HTTP_PROXY/HTTPS_PROXY on windows.

It seems the "user:password" credentials are ignored in the proxy URL for Invoke-Webrequest command when using the "-Proxy" parameter.
cb01282#diff-12d45781f0795c69838b6657fe7fc20701665270bf1c38d4777c6140ea0f72beR44-R46

This means that we still fail with to download since we are not being authenticated.

Interesting, do you have any idea how this worked before the linked commit when we did not pass any proxy?

@slhultgren
Copy link

I believe Invoke-Webrequest uses the system proxy configuration if no -Proxy is provided. In my case this worked(works) fine.
(This meant that in my case Invoke-Webrequest actually still used an authenticated proxy, just not the one I provided in my env vars.)

I also believe that using the -Proxy like this works fine like this as long as you don't require authentication for your proxy.

In my use-case I need to specify HTTP_PROXY/HTTPS_PROXY env vars with authentication for other parts of Yarn/NPM.

So ideally, I think we should try detect if the *_PROXY vars contain authentication, then create a proper user credentials object to supply Invoke-Webrequest with. This seems to be the only way to specify authenticated proxies to Invoke-Webrequest.
I could be wrong though, this is just what I've gathered from some googling, the documentation could be a bit more explicit when it comes to authenticated proxies.

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