jfrog / bower-art-resolver

Apache License 2.0
15 stars 17 forks source link

does not respect no_proxy environment variable. #9

Closed tdietrich513 closed 8 years ago

tdietrich513 commented 8 years ago

The version of request that you are using predates when the request team added support for the no_proxy environment variable. As a result, the proxy will be used no-matter what.

eyalbe4 commented 8 years ago

@tdietrich513, thanks for identifying this! I've just changed the request dependency version to ~2.53.0 (Bower is currently using 2.53.0). This change is not yet published, but you can install the resolver directly from github. Can you see if this change resolves the issue?

monzonj commented 8 years ago

I'm afraid it does not. I even updated to the latest version request@2.63.0 I run a small script to test only the request package and that works fine with the NO_PROXY setting.

It is bower-art-resolver who seems not to be using it.

monzonj commented 8 years ago

This line is causing the issue: https://github.com/JFrogDev/bower-art-resolver/blob/master/lib/request.js#L13

There's no much do to, because the request plugin does not allow to pass noProxy.

I've created a pull request to solve that: https://github.com/request/request/pull/1996

Now there are two posibilities here:

    var _request = request.defaults({
        httpsProxy: config.httpsProxy,
        httpProxy: config.proxy,
        noProxy: config.noProxy,
        ca: config.ca.search[0],
        strictSSL: config.strictSsl,
        timeout: config.timeout
    })
eyalbe4 commented 8 years ago

Thanks for the research and PR @monzonj ! It If you're able to submit a PR for the bower-art-resolver once bower is released with your PR, we'll make sure to release your fix quickly.

brunorubin commented 8 years ago

I'm having issues using this package with a server that is currently behind a HTTP_PROXY.

Have you guys found any workaround to this? I've run some tests locally removing the proxy line to let the request plugin evaluate the environment variables but seems that is not working as well.

cheers.

eyalbe4 commented 8 years ago

@brunorubin, it looks like this PR has not been handled yet. @monzonj suggested to remove the proxy configuration from the bower-art-resolver code and use environment variables to configure the proxy as described in the "Controlling proxy behavior using environment variables" in the request package readme file. @monzonj, have you been able to test this by removing the code and setting the variables? If anyone can confirm that this solution solves the issue, we will make this change to the code.

brunorubin commented 8 years ago

@eyalbe4 thanks for your reply. I've run some tests here and was able to test and confirm that the solution provided by @monzonj solves the issue. There are more details in #20