IHttpServer.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. using Jellyfin.Data.Events;
  5. using MediaBrowser.Model.Services;
  6. using Microsoft.AspNetCore.Http;
  7. namespace MediaBrowser.Controller.Net
  8. {
  9. /// <summary>
  10. /// Interface IHttpServer.
  11. /// </summary>
  12. public interface IHttpServer
  13. {
  14. /// <summary>
  15. /// Gets the URL prefix.
  16. /// </summary>
  17. /// <value>The URL prefix.</value>
  18. string[] UrlPrefixes { get; }
  19. /// <summary>
  20. /// Occurs when [web socket connected].
  21. /// </summary>
  22. event EventHandler<GenericEventArgs<IWebSocketConnection>> WebSocketConnected;
  23. /// <summary>
  24. /// Inits this instance.
  25. /// </summary>
  26. void Init(IEnumerable<Type> serviceTypes, IEnumerable<IWebSocketListener> listener, IEnumerable<string> urlPrefixes);
  27. /// <summary>
  28. /// If set, all requests will respond with this message.
  29. /// </summary>
  30. string GlobalResponse { get; set; }
  31. /// <summary>
  32. /// The HTTP request handler.
  33. /// </summary>
  34. /// <param name="context"></param>
  35. /// <returns></returns>
  36. Task RequestHandler(HttpContext context);
  37. /// <summary>
  38. /// Get the default CORS headers.
  39. /// </summary>
  40. /// <param name="req"></param>
  41. /// <returns></returns>
  42. IDictionary<string, string> GetDefaultCorsHeaders(IRequest req);
  43. }
  44. }