IServerApplicationHost.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Common;
  7. using MediaBrowser.Model.System;
  8. using Microsoft.AspNetCore.Http;
  9. namespace MediaBrowser.Controller
  10. {
  11. /// <summary>
  12. /// Interface IServerApplicationHost
  13. /// </summary>
  14. public interface IServerApplicationHost : IApplicationHost
  15. {
  16. event EventHandler HasUpdateAvailableChanged;
  17. /// <summary>
  18. /// Gets the system info.
  19. /// </summary>
  20. /// <returns>SystemInfo.</returns>
  21. Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken);
  22. Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken);
  23. bool CanLaunchWebBrowser { get; }
  24. /// <summary>
  25. /// Gets the HTTP server port.
  26. /// </summary>
  27. /// <value>The HTTP server port.</value>
  28. int HttpPort { get; }
  29. /// <summary>
  30. /// Gets the HTTPS port.
  31. /// </summary>
  32. /// <value>The HTTPS port.</value>
  33. int HttpsPort { get; }
  34. /// <summary>
  35. /// Gets a value indicating whether [supports HTTPS].
  36. /// </summary>
  37. /// <value><c>true</c> if [supports HTTPS]; otherwise, <c>false</c>.</value>
  38. bool EnableHttps { get; }
  39. /// <summary>
  40. /// Gets a value indicating whether this instance has update available.
  41. /// </summary>
  42. /// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
  43. bool HasUpdateAvailable { get; }
  44. /// <summary>
  45. /// Gets the name of the friendly.
  46. /// </summary>
  47. /// <value>The name of the friendly.</value>
  48. string FriendlyName { get; }
  49. /// <summary>
  50. /// Gets the local ip address.
  51. /// </summary>
  52. /// <value>The local ip address.</value>
  53. Task<List<IPAddress>> GetLocalIpAddresses(CancellationToken cancellationToken);
  54. /// <summary>
  55. /// Gets the local API URL.
  56. /// </summary>
  57. /// <value>The local API URL.</value>
  58. Task<string> GetLocalApiUrl(CancellationToken cancellationToken);
  59. /// <summary>
  60. /// Gets the local API URL.
  61. /// </summary>
  62. /// <param name="hostname">The hostname.</param>
  63. /// <returns>The local API URL.</returns>
  64. string GetLocalApiUrl(ReadOnlySpan<char> hostname);
  65. /// <summary>
  66. /// Gets the local API URL.
  67. /// </summary>
  68. /// <param name="address">The IP address.</param>
  69. /// <returns>The local API URL.</returns>
  70. string GetLocalApiUrl(IPAddress address);
  71. void LaunchUrl(string url);
  72. void EnableLoopback(string appName);
  73. IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo();
  74. string ExpandVirtualPath(string path);
  75. string ReverseVirtualPath(string path);
  76. Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next);
  77. Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next);
  78. }
  79. }