Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Working behind the corporate proxy #14

Open
Divyahb opened this issue Feb 22, 2016 · 0 comments
Open

Working behind the corporate proxy #14

Divyahb opened this issue Feb 22, 2016 · 0 comments

Comments

@Divyahb
Copy link

Divyahb commented Feb 22, 2016

I had a problem in using strider CD. See Issue Strider-CD/strider#902
I placed console.log statements and found out that the path that is constructed in the tunnel.js is incorrect.

I updated with the latest version of tunnel module and now the above error went. But, still I am unable to connect successfully.

My corporate proxy's format is:
http://userid:password@proxy.company.com:PORT

I have set the above to http_proxy environment variable.

I will list out the methods I tried and the resulting scenarios.

Method 1: In main.js, I directly gave

globalTunnel.initialize();

I get the following error in the console.

2016-02-22T14:25:21.745Z - info: { host: 'proxy.company.com',
  port: 8080,
  protocol: 'http:',
  innerProtocol: 'https:',
  method: 'CONNECT',
  path: 'raw.githubusercontent.com:443',
  agent: false }
2016-02-22T14:25:22.053Z - error: Error: tunneling socket could not be establish
ed, cause=Parse Error
    at ClientRequest.onError (C:\Users\772466\Desktop\strider-master\strider-mas
ter\node_modules\global-tunnel\node_modules\tunnel\lib\tunnel.js:164:17)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketOnData (_http_client.js:310:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:523:20)
GET /admin/plugins 500 357.279 ms - -
GET /favicon.ico 200 3.855 ms - -

The connect options looks like this:

{ host: 'proxy.company.com',
  port: 8080,
  protocol: 'http:',
  innerProtocol: 'https:',
  method: 'CONNECT',
  path: 'raw.githubusercontent.com:443',
  agent: false }

Though, I gave http://userid:password@proxy.company.com:PORT format to the http_proxy variable, I am getting a different format in the connect options. Is this correct?

I am not sure whether it is because of the above problem, but I get "tunneling socket could not be established, cause=Parse Error"

Also, have a look at my .npmrc file.

proxy=http://userid:password@proxy.company.com:PORT
https-proxy=http://userid:password@proxy.company.com:PORT
registry=http://registry.npmjs.org/
strict-ssl=false

Method 2: In main.js file, I gave

globalTunnel.initialize({
  tunnel: 'neither',
  host: 'http://userid:password@proxy.company.com',
  port: 8080
});

Now, I am getting the following error in the console.

2016-02-22T14:19:44.401Z - info: { host: 'http://userid:password@proxy.company.com',
  port: 8080,
  protocol: 'http:',
  innerProtocol: 'https:',
  method: 'CONNECT',
  path: 'raw.githubusercontent.com:443',
  agent: false }
2016-02-22T14:19:44.415Z - error: Error: tunneling socket could not be establish
ed, cause=getaddrinfo EAI_FAIL http://userid:password@proxy.company.com:8080
    at ClientRequest.onError (C:\Users\772466\Desktop\strider-master\strider-mas
ter\node_modules\global-tunnel\node_modules\tunnel\lib\tunnel.js:164:17)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketErrorListener (_http_client.js:259:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at connectErrorNT (net.js:996:8)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)
GET /admin/plugins 500 58.205 ms - -
GET /favicon.ico 200 3.671 ms - -

I am getting the getaddrinfo EAI_FAIL error.

I have fiddled with all the npm configuration options and the code, but of no use. What am I doing wrong here?

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

No branches or pull requests

1 participant