protected function extractForFromForwardedHeader($forwarded)
    {
        $ips = [];
        $parts = array_map('trim', explode(',', $forwarded));
        
        foreach ($parts as $part) {
            list($key, $value) = explode('=', $part, 2) + [1 => null];
            
            if ($key === 'for') {
                $ips[] = trim($value, '[]');
            }
        }
        
        return $ips;
    }