private function setClientIPs()
    {
        if ($this->isUsingTrustedProxy()) {
            $this->clientIps = [$this->server->get('REMOTE_ADDR')];
        }
        $clientIps = [];

        if ($this->header->has(self::$trustedHeaderNames[RequestHeaderConstants::FORWARDED])) {
            $header = $this->header->get(self::$trustedHeaderNames[RequestHeaderConstants::FORWARDED]);
            preg_match_all("/for=(?:\"?\[?)([a-z0-9:\.\-\/_]*)/", $header, $matches);
            $clientIps = $matches[1];
        } elseif ($this->header->has(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_IP])) {
            $clientIps = explode(',', $this->header->get(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_IP]));
            $clientIps = array_map('trim', $clientIps);
        }

        $clientIps[] = $this->server->get('REMOTE_ADDR');
        $fallbackClientIps = [$clientIps[0]];

        foreach ($clientIps as $index => $clientIp) {
            // Check for valid IPs
            if (!filter_var($clientIp, FILTER_VALIDATE_IP)) {
                unset($clientIps[$index]);

                continue;
            }

            // Don't allow trusted proxies
            if (in_array($clientIp, self::$trustedProxies)) {
                unset($clientIps[$index]);
            }
        }

        $this->clientIps = (count($clientIps) == 0) ? $fallbackClientIps : array_reverse($clientIps);
    }