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 [supports HTTPS]. /// /// true if [supports HTTPS]; otherwise, false. bool EnableHttps { 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 the local ip address. /// /// The local ip address. Task> GetLocalIpAddresses(CancellationToken cancellationToken); /// /// Gets the local API URL. /// /// Token to cancel the request if needed. /// Whether to force usage of plain HTTP protocol. /// The local API URL. Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp = false); /// /// Gets the local API URL. /// /// The hostname. /// Whether to force usage of plain HTTP protocol. /// The local API URL. string GetLocalApiUrl(ReadOnlySpan hostname, bool forceHttp = false); /// /// Gets the local API URL. /// /// The IP address. /// Whether to force usage of plain HTTP protocol. /// The local API URL. string GetLocalApiUrl(IPAddress address, bool forceHttp = false); /// /// 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); } }