tim-bezhashvyly/geoip — pull request #7 by ProxiBlue (2013-12-13 02:45:14+00:00)
Title: $SERVER['REMOTEADDR'] will not contain the actual IP of the client accessing the site, but that of any behind a reverse proxy 

$SERVER['REMOTEADDR'] will not contain the actual IP of the client accessing the site, but that of any behind a reverse proxy

Using a call to Mage::helper('core/http')->getRemoteAddr() instead will produce the correct, expected results, if the required directive were set in the sites config.xml to correctly populate remote_addr

as an example:

HTTP_X_REAL_IP
HTTP_X_FORWARDED_FOR

Additionally, no check is done that REMOTE_ADDR array key was in fact existing.
This would throw an error: Undefined index: REMOTE_ADDR in /app/code/community/Openstream/GeoIP/Model/Country.php on line 12

This can happen when a cron job is causing the GEOIP code to run. - This happens in magento EE send_notifications cron job.