private function getXForwardedIp($entries)
    {
        $ip = $this->ip;
        while (list(, $entry) = each($entries)) {
            $entry = trim($entry);
            if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $entry, $ip_list)) {
                $found_ip = preg_replace( $this->privateIp, $ip, $ip_list[1]);

                if ($ip != $found_ip) {
                    $ip = $found_ip;
                    break;
                }
            }
        }
        return $ip;
    }