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

Working behind the corporate proxy #902

Open
Divyahb opened this issue Jan 13, 2016 · 3 comments
Open

Working behind the corporate proxy #902

Divyahb opened this issue Jan 13, 2016 · 3 comments

Comments

@Divyahb
Copy link

Divyahb commented Jan 13, 2016

I am unable to work behind a corporate proxy.

I referred to this link (#738) and then set the environment variables as specified in the link.

My .npmrc file looks like this.

proxy=http://proxy:port/
http-proxy=http://proxy:port/
https-proxy=http://proxy:port/
registry=http://registry.npmjs.org/

And the environment variables HTTP_PROXY, HTTPS_PROXY.

All the other npm modules are getting downloaded fine and all node applications are working fine using this proxy settings.

But, Strider threw an error while accessing admin/plugins, while connecting with gitlab and failed trying to set up a manual project.

image

As mentioned in the issue 738, I tried setting up another environment variable http_proxy.

Then my global tunnel was using the environment variable. Now, I am getting the below error.

image

I explored many links and followed the mentioned in them. But, of no use. Is this an issue or am I doing something wrong?

@knownasilya
Copy link
Member

Sounds unrelated to the proxy, but probably a bug to do with file system paths not having the correct separator, since you are on windows.

@knownasilya
Copy link
Member

Looks like an issue with tunnel or globel-tunnel modules. If you could put a console log in the relavant place, that would help figure out what the path looks like.

@Divyahb
Copy link
Author

Divyahb commented Feb 22, 2016

I found out the issue. But, not sure how to solve it. 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?

I have also raised this issue in Global-Tunnel salesforce/global-tunnel#14

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

2 participants