Skip to content
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

Double ip address not returning proper location #25

Closed
rickshawhobo opened this issue Apr 10, 2015 · 8 comments
Closed

Double ip address not returning proper location #25

rickshawhobo opened this issue Apr 10, 2015 · 8 comments

Comments

@rickshawhobo
Copy link

Hello
After much debug I discovered that my server is returning a double ip address for the remote ip. The remote ip looks like xxx.xxx.xxx.xxx, yyy.yyy.yyy.yyy and the resulting location is returned with default => 1

The double IP is coming from an apache config involving reverse proxy and I have no control over it. Perhaps the package could account for it and just take the first ip?

@kyranb
Copy link
Contributor

kyranb commented Apr 10, 2015

Any reason why this package needs that functionality? Are you able to parse the ip address yourself, then call getLocation() with that ip address?

@rickshawhobo
Copy link
Author

The reason I use a package is for convenience. Yes I could parse the ip myself and specify it, but then I can also just call the maxmind api myself. If double ip's are common enough (apparently they are - I never realized) then maybe the package can just handle it. It's an easy and safe change.

@kyranb
Copy link
Contributor

kyranb commented Apr 11, 2015

I can't say that I've ever come across double ip addresses before. I agree that if they are commonly used, it would make sense to automatically account for them.

@tremby
Copy link

tremby commented Jun 24, 2015

It'll look like that in some cases when a chain of addresses is available, for instance when behind a proxy or load balancer.

@king724
Copy link

king724 commented Oct 11, 2016

This is happening to me behind a CDN. I've seen it return up to 4 IPs in a comma seperated list. The first one is always the one I want.

Torann added a commit that referenced this issue Oct 17, 2016
@Torann
Copy link
Owner

Torann commented Oct 17, 2016

Give v1.0.2 a try

@king724
Copy link

king724 commented Oct 18, 2016

@Torann works great for me, thanks!

@Torann
Copy link
Owner

Torann commented Oct 18, 2016

Good to hear :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants