Check to see if the host matches the route requirements

@param string $host The request's host name
@return bool Whether or not the host matches any conditions set in for this route.
493145
public function hostMatches($host)
    {
        $pattern = '@^' . str_replace('\*', '.*', preg_quote($this->options['_host'], '@')) . '$@';

        return preg_match($pattern, $host) !== 0;
    }
1208219
public function isOneOfHosts(array $hosts)
    {
        foreach ($hosts as $host) {
            if ($this->matchHost($host)) {
                return true;
            }
        }

        return false;
    }
1142147
protected function _matchHost($url) {
        $components = parse_url($url);
        return !(isset($components['host']) && $components['host'] != $this->_hostname());
    }
185927
function _filterHost($host)
    {
        if (strstr($host, ':') !== false)
            throw new \InvalidArgumentException('Host name can`t contains port number.');

        $host = strtolower($host);
        return $host;
    }
721090
public function match($url)
    {
        foreach ($this->routes as $route => $params) {
            if (preg_match($route, $url, $matches)) {
                //Check if given method is matched
                if ($this->methodMatch($params['method'], null, new Request())) {
                    // Get named capture group values
                    foreach ($matches as $key => $match) {
                        if (is_string($key)) {
                            $params[$key] = $match;
                        }
                    }
                    $this->params = $params;

                    return true;
                }
            }
        }
    }
1336741
public boolean isHostProxyable(String host) {
        return getProxyHost() != null
                && getProxyPort() > 0
                && (nonProxyPattern == null || !nonProxyPattern.matcher(host)
                        .matches());
    }
807647
public function hasPushService($host) : bool
    {
        foreach ($this->pushServices as $pushService) {
            if ($pushService->supportsHost($host)) {
                return true;
            }
        }

        return false;
    }
420704
public function check($host)
    {
        $this->validHost($host);

        $host = trim($host);
        $valid = false; // init as false
        $this->file->rewind();

        while (!$this->file->eof()) {
            $pattern = '/\b'.$host.'\b/i';
            if (preg_match($pattern, $this->file->current())) {
                $valid = trim($this->file->current());
                break; // Once you find the string, you should break out the loop.
            }
            $this->file->next();
        }

        return $valid;
    }
352716
public function match(string $path, ?string $method, ?string $host): ?RouteInterface{
        if("/" !== mb_substr($path, 0, 1)){
            $path   = "/" . $path;
        }

        $stack      = new \SplStack();

        foreach(array_reverse(explode("/", $path)) as $segment){
            $stack->push($segment);
        }

        return $this->recursionMatch($this->rootNode, $stack, $method, $host);
    }
1019456
public function equals(HostInterface $host): bool
    {
        if ($this->getIPAddress() !== null && $host->getIPAddress() !== null) {
            return $this->getIPAddress()->equals($host->getIPAddress());
        }

        return $this->getHostname()->equals($host->getHostname());
    }
148037
public static function isValidHost($host)
    {
        //Simple syntax limits
        if (empty($host)
            or !is_string($host)
            or strlen($host) > 256
        ) {
            return false;
        }
        //Looks like a bracketed IPv6 address
        if (trim($host, '[]') != $host) {
            return (bool) filter_var(trim($host, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
        }
        //If removing all the dots results in a numeric string, it must be an IPv4 address.
        //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names
        if (is_numeric(str_replace('.', '', $host))) {
            //Is it a valid IPv4 address?
            return (bool) filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
        }
        if (filter_var('http://' . $host, FILTER_VALIDATE_URL)) {
            //Is it a syntactically valid hostname?
            return true;
        }

        return false;
    }
209259
public function matches(Route $route, Request $request)
	{
		if (is_null($route->getCompiled()->getHostRegex())) return true;

		return preg_match($route->getCompiled()->getHostRegex(), $request->getHost());
	}
840545
public static function isLocalHost($host)
    {
        if (empty($host)) {
            return false;
        }

        // remove port
        $hostWithoutPort = explode(':', $host);
        array_pop($hostWithoutPort);
        $hostWithoutPort = implode(':', $hostWithoutPort);

        $localHostnames = Url::getLocalHostnames();
        return in_array($host, $localHostnames, true)
            || in_array($hostWithoutPort, $localHostnames, true);
    }
1132249
public function host($host = null)
    {
        $this->host = empty($host) ? null : $host;

        return $this->host;
    }
238256
function match(RequestInterface $request)
    {
        ## host may have port
        /** @var RequestInterface $request */
        $host = $request->getHeaderLine('Host');
        if (! $host )
            throw new \Exception('Host not recognized in Request.');

        $criteria   = $this->getCriteria();
        $parts      = \Poirot\Std\Lexer\parseCriteria($criteria, '.');
        $regexMatch = \Poirot\Std\Lexer\buildRegexFromParsed($parts);
        $result     = preg_match('(^' . $regexMatch . '$)', $host, $matches);


        if (! $result )
            ## route not matched
            return false;

        ## merge match params definition:
        $params = array();
        foreach ($matches as $index => $val) {
            if (is_int($index)) continue;

            $params[$index] = $val;
        }

        $routerMatch = clone $this;
        if (! empty($params))
            \Poirot\Router\mergeParamsIntoRouter($routerMatch, $params);

        return $routerMatch;
    }
1298413
protected function host_explicitly_blocked($host) {
        $blockedhosts = $this->get_blacklisted_hosts_by_category();
        $domainhostsblocked = array_merge($blockedhosts['domain'], $blockedhosts['domainwildcard']);
        return ip_utils::is_domain_in_allowed_list($host, $domainhostsblocked);
    }
129105
public function getHost(string $host)
	{
		$host = Host::filter($host);
		return $this->offsetExists($host) ? $this->hosts[$host] : null;
	}