-
Notifications
You must be signed in to change notification settings - Fork 654
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
proxy issues (X-Forwarded-For header related) #254
Comments
No idea. You can however use curl to check, just to make sure it's header that's causing trouble: $ curl -H 'X-Forwarded-For: 1.2.3.4' https://registry.npmjs.org/ PS: hmm... this reminds me of an issue #19 from 1.5 years ago we never managed to solve. I wonder, what proxy server (as in software version) does your organization use? |
It does appear to be the header. This works: This fails I read issue #19 before I cracked open the source :) I'm not sure what proxy software is being used (nor it's config) but I'll dig about and see if I can find out. Thanks for coming back. |
It's not that important a feature to have, and it could break some proxies. ref #254
Our infrastructure guys haven't come back to me on this. It's not a sinopia issue so I'm closing it. Thanks for the help. |
I conditionally disabled |
Hi
Firstly, thanks for all the hard work, much appreciated :)
I've setup sinopia on a linux box which can only access a single site (http://registry.npmjs.org) via it's proxy.
On this box when I have
http_proxy
set in my profile. I cancurl http://registry.npmjs.org
. However when I spin up sinopia I get 407s trying to issues requests to the upstream repo.I tried setting
http_proxy
in various places,.bashrc
(gets loaded from.bash_profile
),.npmrc
, withinconfig.yaml
nothing worked.I dug into the src to find sinopia is using
request
to issue the request (see here).I did some hacking to see what gets set here as the request is created, when wrote a little spike to see what's the issue with the usage of
request
. I found thatrequest
itself honorshttp_proxy
set in my profile. In the spike below, example 1 (how sinopia makes the request) doesn't work (status = 407), but example 2 does (status = 200, same as example 1 but without X-Forwarded-For).At this point I can get the whole thing working by commenting out these lines, but don't fully understand why.
X-Forwarded-For is the IP address of my local work station, and from what I read on X-Forwarded-For it seems sensible. Perhaps this is just an edge case our organisation proxy doesn't like?
Any ideas?
The text was updated successfully, but these errors were encountered: