-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
ipAddr sometimes wrong #57
Comments
I'm not sure, but we use the IP address that is provided by Meteor so I'd try and replicate an example where this happens and open an issue with them. Perhaps the user is behind a corporate proxy and there are multiple |
connection.httpHeaders shows the x-forwarded-for right? I'll try this and see what happens
|
It looks like x-forwarded-for sometimes has two ips seperated by a comma. The first is their ip and the second is 127.0.0.1. When that happens clientAddress is 127.0.0.1 I'll post an issue for it and see what they say. |
What do you think about doing what glasser said in meteor/meteor#3981? Parsing x-forwarded-for and choosing the correct one? |
I don't know, that seems like something that we should get into Meteor core, not necessarily this package. But we could make a workaround until it is accepted, if you want to try a PR. I think in some previous user IP packages, someone came up with the correct computation of pulling out IPs from X-Forwarded-For. |
Here's some info I found about it. http://serverfault.com/a/414166 Sounds like it should go from right to left and pick the first one that's not a trusted ip. Trusted ips I guess could be 192.168.2.1 and 127.0.0.1. |
FYI for anyone getting |
I guess for trusted IPs the user would have to be able to specify them somehow in the config for this package, possibly with subnet masks (i.e. |
ipAddr is correct for about 90% of users. About 10% have it as 127.0.0.1. I have HTTP_FORWARDED_COUNT set to 1. Any idea why it would sometimes be correct and sometimes not?
The text was updated successfully, but these errors were encountered: