using System; using System.Collections.Generic; using System.Net; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common; using MediaBrowser.Model.System; using Microsoft.AspNetCore.Http; namespace MediaBrowser.Controller { /// /// Interface IServerApplicationHost /// public interface IServerApplicationHost : IApplicationHost { event EventHandler HasUpdateAvailableChanged; /// /// Gets the system info. /// /// SystemInfo. Task GetSystemInfo(CancellationToken cancellationToken); Task GetPublicSystemInfo(CancellationToken cancellationToken); bool CanLaunchWebBrowser { get; } /// /// Gets the HTTP server port. /// /// The HTTP server port. int HttpPort { get; } /// /// Gets the HTTPS port. /// /// The HTTPS port. int HttpsPort { get; } /// /// Gets a value indicating whether the server should listen on an HTTPS port. /// bool ListenWithHttps { get; } /// /// Gets a value indicating whether this instance has update available. /// /// true if this instance has update available; otherwise, false. bool HasUpdateAvailable { get; } /// /// Gets the name of the friendly. /// /// The name of the friendly. string FriendlyName { get; } /// /// Gets all the local IP addresses of this API instance. Each address is validated by sending a 'ping' request /// to the API that should exist at the address. /// /// A cancellation token that can be used to cancel the task. /// A list containing all the local IP addresses of the server. Task> GetLocalIpAddresses(CancellationToken cancellationToken); /// /// Gets a local (LAN) URL that can be used to access the API. The hostname used is the first valid configured /// IP address that can be found via . /// /// A cancellation token that can be used to cancel the task. /// The server URL. Task GetLocalApiUrl(CancellationToken cancellationToken); /// /// Gets a local (LAN) URL that can be used to access the API. /// /// The hostname to use in the URL. /// The API URL. string GetLocalApiUrl(ReadOnlySpan hostname); /// /// Gets a local (LAN) URL that can be used to access the API. /// /// The IP address to use as the hostname in the URL. /// The API URL. string GetLocalApiUrl(IPAddress address); /// /// Open a URL in an external browser window. /// /// The URL to open. /// is false. void LaunchUrl(string url); void EnableLoopback(string appName); IEnumerable GetWakeOnLanInfo(); string ExpandVirtualPath(string path); string ReverseVirtualPath(string path); Task ExecuteHttpHandlerAsync(HttpContext context, Func next); Task ExecuteWebsocketHandlerAsync(HttpContext context, Func next); } }