-
Notifications
You must be signed in to change notification settings - Fork 72
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
cache isn't working via npm install behind proxy #30
Comments
Do you mean In any case can you run the wget that works with the |
ok, thanks for the clarification. So the issue is that npm_lazy hangs when trying to connect externally in response to your request against localhost. Can you run I am assuming |
wget -d registry.npmjs.org/lodash
DEBUG output created by Wget 1.12 on linux-gnu.
--2014-04-04 10:15:41-- http://registry.npmjs.org/lodash
Connecting to 171.27.1.254:3128... connected.
Created socket 3.
Releasing 0x0000000001990bd0 (new refcount 0).
Deleting unused 0x0000000001990bd0.
---request begin---
GET http://registry.npmjs.org/lodash HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: registry.npmjs.org
---request end---
Proxy request sent, awaiting response...
---response begin---
HTTP/1.0 200 OK
Age: 3399
Via: 1.1 varnish, 1.1 varnish, 1.0 localhost (squid/3.1.6), 1.0 171.27.1.254 (McAfee Web Gateway 7.4.1.1.0.17024)
Date: Fri, 04 Apr 2014 08:15:41 GMT
ETag: "AJSV8HHNVCYLT3DO196P8YWMI"
Vary: Accept
Server: CouchDB/1.5.0 (Erlang OTP/R14B04)
X-Cache: MISS, MISS
X-Cache: MISS from localhost
X-Timer: S1396595942.354797840,VS0,VS42,VE223,VE3399068
X-Served-By: cache-v41-ASH, cache-am72-AMS
Content-Type: application/json
X-Cache-Hits: 0, 0
Accept-Ranges: bytes
Cache-Control: max-age=1
Content-Length: 70809
X-Cache-Lookup: MISS from localhost:8080
Proxy-Connection: Close
---response end---
200 OK
Length: 70809 (69K) [application/json]
Saving to: “lodash”
100%[===================================================================================================================>] 70,809 --.-K/s in 0.1s
Closed fd 3
2014-04-04 10:15:41 (632 KB/s) - “lodash” saved [70809/70809]
|
Nothing looks obviously wrong in the headers. Now that I think of it, are you using the npm Because it would make a lot of sense that it looks like this stuff also uses environment variables: https://www.npmjs.org/doc/misc/npm-config.html so maybe try:
those should both return null. If that works then: Edit: it would kind of make sense that npm does not special case localhost requests when doing proxying, as having the client and the registry on the same machine is not a common case. |
ha! works. man, you're the best. Thanks so much! 🎉 summaryyeah I've had proxy config in .npmrc, and also in env variables
;proxy = http://171.27.1.254:3128/
;https-proxy = https://171.27.1.254:3128/
strict-ssl = false
;registry = http://registry.npmjs.org/
registry = http://localhost:9000
proxy: {
'http' : 'http://my-proxy-ip:port',
'https' : 'https://my-proxy-ip:port'
}
|
awesome, I'll add a note to the readme about this. thanks for your help in debugging this! |
This is all well and good until you install a package like imagemin. Which brings in pngquant, which goes to github via https and cannot download stuff. ⚠ connect ETIMEDOUT I am afraid it is not possible to run npm_lazy on localhost because of the utterly stupid way npm handles requests to localhost. There is not a single use-case in this quadrant of our galaxy where requests to localhost aka 127.0.0.1 is supposed to be sent off to a proxy. |
Hi, I'm trying to setup npm_lazy on corporate server ( runs on centOS ) but without any luck.
I've configured the proxy settings in config file.
When I run npm_lazy:
[root@ITAP11 ~] npm_lazy -c ./npm_lazy.config.js app info npm_lazy at 0.0.0.0 port 9000 app info npm_lazy cache directory: /root/.npm_lazy app info Using http://171.27.1.254:3128 to proxy http requests. app info Using https://171.27.1.254:3128 to proxy https requests.
now when i run
npm install --registry http://localhost:9000 lodash
this is what I get:
but when I run request via wget, it works and correctly saves package to ~/.npm_lazy/
wget http://localhost:9000/lodash
any ideas?
thanks in advance
The text was updated successfully, but these errors were encountered: