Issue with IP Headers for Geo IP use

Search
Other Bug Reports questions
Forum

Issue with IP Headers for Geo IP use

Luiz Felipe  Tavares's Avatar Luiz Felipe Tavares
I noticed that the GeoIP library was not being able to recognize the IP address of any users in my website, when reviewing the code of the GeoIP Library I noticed that the IP address of my website users is not available in any of the header variables that the getIP method is looking.

This method looks for the User IP in the following headers: HTTP_X_FORWARDED_FOR, HTTP_X_REAL_IP, HTTP_CLIENT_IP

I use Cloudflare with my website, to proxy requests to my server and for some reason the IP Address of my users is not available in any of the above headers. However, Cloudflare adds the Header HTTP_CF_CONNECTING_IP with the IP address of the user.

So I changed the getIp method to include this Header and GeoIp is working as expected. I was wondering if there is some way to include this change as an override to the library so that I can keep updating Regular Labs GeoIp Extension without losing this change every time I update? Can anyone help me with that?

I will also try to change settings in my cloudflare account to include one of the originally checked headers.
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases

Alternatively you can also switch on the "Restore Original Visitor IP" option at Cloudflare.
Please post a rating at the Joomla! Extensions Directory
Luiz Felipe  Tavares's Avatar Luiz Felipe Tavares
Thank you for the quick assistance!

The development version works as expected.
Peter van Westen's Avatar Peter van Westen ADMIN
Ok, great 🙂
The fix will be included in the next release.
Please post a rating at the Joomla! Extensions Directory
You can only post on this forum if you log in