code: public function setHttps($option = false)
      {
          if (!in_array($option, [true, false])) {
              throw new InvalidArgumentException('Incorrect option', 403);
          }
  
          if ($option === true) {
              $this->requestPrefix = 'https://';
          } else {
              $this->requestPrefix = 'http://';
              if ((isset($_SERVER['REQUEST_SCHEME']) and (!empty($_SERVER['REQUEST_SCHEME']) and ($_SERVER['REQUEST_SCHEME'] === 'https') or !empty($_SERVER['HTTPS']) and $_SERVER['HTTPS'] === 'on') or (!empty($_SERVER['SERVER_PORT']) and $_SERVER['SERVER_PORT'] === '443'))) {
                  $this->requestPrefix = 'https://';
              }
          }
  
          $this->https = $option;
  
          return $this;
      }
docs: Set up http/https
  
  @param bool $option
  
  @return $this