private function autodetect_host() {
		if ($this->host !== null)
			return;
		$proto = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])
			? 'https://' : 'http://';
		$host = isset($_SERVER['SERVER_NAME'])
			? $_SERVER['HTTP_HOST'] : 'localhost';
		$port = isset($_SERVER['SERVER_PORT'])
			? (int)$_SERVER['SERVER_PORT'] : null;
		// @codeCoverageIgnoreStart
		$port = $this->verify_port($port, $proto);
		if ($port && (strpos($host, ':') === false))
			$host .= ':' . $port;
		// @codeCoverageIgnoreEnd
		$host = str_replace([':80', ':443'], '', $host);
		$this->host = $proto . $host . $this->home;
	}