request / tunnel-agent

HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
Apache License 2.0
117 stars 105 forks source link

Error: vscode-ripgrep@0.0.11 postinstall: `node ./dist/postinstall.js` #26

Open mrkafk opened 7 years ago

mrkafk commented 7 years ago

Hello,

I've had problems building VSCode behind the HTTP+HTTPS proxy related to tunnel-agent, details here: https://github.com/Microsoft/vscode/issues/24805

Summary of the problem:

I managed to debug the issue - it seems like tunnel-agent expects request options to contain references to .host and .port directly at top dictionary level while somehow in current vscode npm modules options has it wrapped into a contained host dictionary:

{
  "host": {
    "_defaultAgent": {
      "domain": null,
      "_events": {},
      ...

Changing file vscode\node_modules\tunnel-agent\index.js, function createSocket from:

, path: options.host + ':' + options.port

to

, path: options.host.host + ':' + options.host.port

and in createSecureSocket from:

{ servername: options.host

to

{ servername: options.host.host

fixed the issue, after that npm install vscode-ripgrep@0.0.11 worked without a problem.

To reiterate, this only happens behind http+https proxy. I've built vscode at home while not behind the proxy and it all worked without a hitch.