public function getPort() : string
  {
      // Check for proxy first
      $port = self::server('HTTP_X_FORWARDED_PORT');
      if ($port) {
          return (string)$port;
      }

      $protocol = (string)self::server('HTTP_X_FORWARDED_PROTO');
      if ($protocol === 'https') {
          return '443';
      }

      return (string)self::server('SERVER_PORT');
  }