-
Notifications
You must be signed in to change notification settings - Fork 1.3k
node-sass ignores proxy settings when trying to download binaries #768
Comments
Does truncating the trailing slash in proxy URL help?
to
|
No, this has no effect. |
On extra detail that might be relevant: this local proxy actually has it own organization-issued (and self signed) root certificate authority that is used to override the certificates provided by all HTTPS websites. This means that all HTTPS websites will appear to be signed by this root CA. This root CA is installed in the OS wide trust store, but I'm not sure what trust store is used by node-sass, the request module or npm. |
Please see this comment: #705 (comment) and post the output. Also you can go through that thread and the related in issue tracker to find some pointers. |
OK, so after some more investigation, it turns out that the problem is caused by the fact that a simple HTTPS proxy is not supported for HTTPS requests. It works if This is the complete opposite of all the other applications on my system (including browsers, curl, wget, maven, eclipse, IntelliJ, apt, etc...). The way this works now is really, really counter intuitive, and probably needs to be fixed. |
I've been experimenting a bit more with the A fix that could make it work for many people would be to try to download the binary using the This all seems to be due to the HTTP tunneling used by the request module when using proxies. This apparently only works when the proxy is contacted using HTTP (at least with the default settings of cntlm). For some reason, setting |
I struggled with a similar issue and used the same "fix": set npm's |
The problem for me, is that our build script must work across all locations of the organization, and some locations don't use a proxy or use a different one. Therefore setting the proxy URL in the build script is a no go for us. The proxy should be read from the system which is apparently what happens, because the proxy URL is correctly picked up when I don't explicitly specify it. Trying the download in a couple of different ways could be enough to fix the problem for me (and apparently also for fvsch). |
Thanks for sharing your thoughts. We can definitely retry downloading with all available proxies, but IMO, it is not the efficient solution of this problem in general. As you witnessed, this is either an issue with request or it's a bug in underlying node.js/io.js network layer. Looking into (solution from request/request#1382, which we can handle in our code) Does adding the following line at install.js#L27 help: options.headers = {'User-Agent': 'foo'} ? I am not behind proxy server, so unfortunately I cannot confirm it. Also, I am all for fixing this issue in our code or where it is originating from (request/node.js) but offload the solution to consumer space. |
The request/request#1357 doesn't contain enough information to be useful. request/request#367 seems to be related to self signed certificates, which in my case could apply (I need to do some further checks) |
@npiguet, have you considered opening this issue with request, detailing your use-case and setup? |
After more debugging with wireshark and cntlm's debug mode, it turns out that the proxy is indeed being called, but is apparently called with some illegal characters causing it to fail. So it seems that ultimately, the issue is with the request module. However, this install problem seems to be common enough to require a workaround in the node-sass installer. |
Thanks for the follow up @npiguet. Adding this to v3 milestone. Feel free to send a PR, I won't have time to visit this until after next beta. |
@npiguet Can you post (privately here is my PGP key if you need) your wireshark dumps? I have configured a litte proxy for myself and I am using
and it works. Please keep in mind that SSL proxying works also via plain HTTP (it uses As far as NPM is concerned, you can also set npm proxy by setting environment variable |
thnx @npiguet |
If I'm understanding correctly this is not a node-sass issue. Closing this until there is clear action we can take. |
Error when instantiating a map with duplicate keys
I'm in an environment where I am required to run a local proxy, and I am unable to install node-sass. The output of node-sass looks like:
I've tried setting the proxy in multiple ways, but none of them seem to work:
through environment variables:
through
.npmrc
through command line arguments
None of this works. I know for sure that the proxy not used because I don't see any requests to
https://github.com/sass/node-sass/releases/download//v.....
anywhere in the logs of my proxy.Note that all of the other modules I need are installed correctly by npm, that npm does use the proxy and that I can see all of its requests my proxy logs
I'm on ubuntu 14.04, and using node v0.12.0, npmVersion 2.5.1 (via frontend-maven-plugin)
Also note that the messages above are for version 3.0.0-alpha.0, but I get the same error with version 2.0.1 and 3.0.0-pre
The text was updated successfully, but these errors were encountered: