Gets the host.

@return string The starting uri based on the host
172172
protected function getHost()
    {
        $host = $this->host;
        $scheme = 'http';

        if (preg_match('/:443$/', $this->host)) {
            $scheme = 'https';
            $host = preg_replace('/:443$/', '', $this->host);
        }

        return $scheme.'://'.$host;
    }
42744
public function getHost()
    {
        $hostClass = $this->hostClass;
        $user = $hostClass::buildNoInitModel();
        /* @var BaseUserModel $user */
        return $this->hasOne($hostClass::className(), [$user->guidAttribute => 'createdBy']);
    }
1235643
public static function getHostname()
    {
        $hostname = $_SERVER['HTTP_HOST']; 

        if (isset($_SERVER['HTTPS']))
        {
            $hostname = 'https://' . $hostname;
        }
        else
        {
            $hostname = 'http://' . $hostname;
        }
        
        return $hostname;
    }
1306364
public static function serverURL()
    {
        $host = self::hostname();
        $url = '';
        if ( $host )
        {
            if ( self::isSSLNow() )
            {
                // https case
                $host = preg_replace( '/:\d+$/', '', $host );

                $ini = eZINI::instance();
                $sslPort = $ini->variable( 'SiteSettings', 'SSLPort' );

                $sslPortString = ( $sslPort == eZSSLZone::DEFAULT_SSL_PORT ) ? '' : ":$sslPort";
                $url = "https://" . $host  . $sslPortString;
            }
            else
            {
                $url = "http://" . $host;
            }
        }
        return $url;
    }
1328064
public static function getHostUri()
  {
    $sheme = (self::getHostParam("HTTPS") == "on") ? "https" : "http";

    $serverName = new Str(self::getHostParam("HTTP_HOST"));
    $serverPort = self::getHostParam("SERVER_PORT");
    $serverPort = ($serverPort != 80 && $serverPort != 443) ? ":" . $serverPort : "";

    if($serverName->endsWith($serverPort))
    {
      $serverName = $serverName->replace($serverPort, "");
    }

    return new Str($sheme . "://" . $serverName . $serverPort);
  }
1047648
protected function vhost()
	{
		if (isset($_SERVER['HTTP_X_FORWARDED_HOST']))
		{
			return preg_replace('/[^A-Za-z0-9\[\]\.:-]/', '', rtrim($_SERVER['HTTP_X_FORWARDED_HOST'],'/'));
		}
		
		$host = rtrim($_SERVER['HTTP_HOST']);
		if ($host == '')
		{
			$host = rtrim($_SERVER['SERVER_NAME']);
		}
		$host  = preg_replace('/[^A-Za-z0-9\[\]\.:-]/', '', $host);
		return $host;
	}
144085
public function getURL() {
		return $this->scheme.'://'.$this->domain.$this->path.($this->parameters ? '?'.http_build_query($this->parameters) : '');
	}
1026402
public function getDomain()
    {
        $uri = $this->getServiceLocator()->get('Application')->getMvcEvent()->getRequest()->getUri();
        return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
    }
116980
protected function getCurrentUrl() {
        $isHttps = $this->getServerVar('HTTPS');
        $forwardedProto = $this->getServerVar('HTTP_X_FORWARDED_PROTO');
        if ($isHttps == 'on' || $forwardedProto === 'https') {
            $schema = 'https://';
        } else {
            $schema = 'http://';
        }

        $host = $this->getServerVar('HTTP_HOST');

        if (preg_match('#:(\d+)$#', $host, $match)) {
            $port = ':' . $match[1];
        } else {
            $port = '';
        }
        $urls = parse_url($this->getServerVar('REQUEST_URI'));

        $path = $urls['path'];
        $query = '';

        return $schema . $host . $port . $path . $query;
    }
607004
public function getHost()
    {
        $host = $this->getServer('HTTP_HOST') ?: $this->getServer('SERVER_NAME') ?: $this->getServer('REMOTE_ADDR');
        return preg_replace('/:\d+$/', '', $host);
    }
542381
public function getUri(): string
    {
        $configuration = GeneralUtility::makeInstance(ConfigurationService::class);

        // Find host-name / IP, always in lowercase:
        $isHttp = (0 === \mb_strpos(GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'), 'http://'));
        $uri = GeneralUtility::getIndpEnv('REQUEST_URI');
        if ($configuration->isBool('recreateURI')) {
            $uri = $this->recreateUriPath($uri);
        }

        $uri = ($isHttp ? 'http://' : 'https://') . \mb_strtolower(GeneralUtility::getIndpEnv('HTTP_HOST')) . '/' . \ltrim($uri, '/');

        try {
            $idnaConverter = GeneralUtility::makeInstance(IdnaConvert::class);

            return $idnaConverter->encode($uri);
        } catch (\InvalidArgumentException $exception) {
            // The URI is already in puny code (no logging needed)
            return $uri;
        }
    }
1156131
public synchronized final String getHost() {
        if (host == null) {
            if (getEndpointAddress() != null && 
                    !getEndpointAddress().isUnresolved()) {
                host = getEndpointAddress().getHostName();
            }

            if (host == null && httpURI != null) {
                try {
                    host = (new URL(httpURI)).getHost();
                } catch (MalformedURLException e) {
                    logger.debug("Malformed URL", e);
                }
            }
        }

        return host;
    }
184368
public function getHost()
    {
        if (isset($this->env['HOST'])) {
            if (strpos($this->env['HOST'], ':') !== false) {
                $hostParts = explode(':', $this->env['HOST']);

                return $hostParts[0];
            }

            return $this->env['HOST'];
        } else {
            return $this->env['SERVER_NAME'];
        }
    }
983600
protected function getCurrentUrl()
    {
        $schema = ((!empty($this->server['HTTPS']) && $this->server['HTTPS'] !== 'off') || (!empty($this->server['SERVER_PORT']) && $this->server['SERVER_PORT'] == 443)) ? 'https://' : 'http://';

        $host = isset($this->server['HTTP_HOST']) ? $this->server['HTTP_HOST'] : 'localhost';

        return $schema.$host.$this->server['REQUEST_URI'];
    }
406736
public function getHostname()
    {
        if (is_null($this->hostname)) {
            $this->hostname = gethostbyaddr($this->ip);
        }

        return $this->hostname;
    }
225182
public function getHost()
    {
        $host = $this->headers->get('HTTP_HOST');
        if ($host) {
            if (strpos($host, ':') !== false) {
                $hostParts = explode(':', $host);

                return $hostParts[0];
            }

            return $host;
        }

        return $this->env->get('SERVER_NAME');
    }
22364
protected static function getBaseUrl()
  {
    $baseUrl = 'https://';
    if (!self::$ssl) {
      $baseUrl = 'http://';
    }
    $baseUrl .= sprintf('%s:%s/%s/', self::$host, self::$port, self::$context);
    return $baseUrl;
  }