IHttpServer.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. namespace MediaBrowser.Controller.Net
  4. {
  5. /// <summary>
  6. /// Interface IHttpServer
  7. /// </summary>
  8. public interface IHttpServer : IDisposable
  9. {
  10. /// <summary>
  11. /// Gets the URL prefix.
  12. /// </summary>
  13. /// <value>The URL prefix.</value>
  14. IEnumerable<string> UrlPrefixes { get; }
  15. /// <summary>
  16. /// Gets the certificate path.
  17. /// </summary>
  18. /// <value>The certificate path.</value>
  19. string CertificatePath { get; }
  20. /// <summary>
  21. /// Starts the specified server name.
  22. /// </summary>
  23. /// <param name="urlPrefixes">The URL prefixes.</param>
  24. /// <param name="certificatePath">If an https prefix is specified,
  25. /// the ssl certificate localtion on the file system.</param>
  26. void StartServer(IEnumerable<string> urlPrefixes, string certificatePath);
  27. /// <summary>
  28. /// Stops this instance.
  29. /// </summary>
  30. void Stop();
  31. /// <summary>
  32. /// Occurs when [web socket connected].
  33. /// </summary>
  34. event EventHandler<WebSocketConnectEventArgs> WebSocketConnected;
  35. /// <summary>
  36. /// Occurs when [web socket connecting].
  37. /// </summary>
  38. event EventHandler<WebSocketConnectingEventArgs> WebSocketConnecting;
  39. /// <summary>
  40. /// Inits this instance.
  41. /// </summary>
  42. void Init(IEnumerable<IRestfulService> services);
  43. /// <summary>
  44. /// If set, all requests will respond with this message
  45. /// </summary>
  46. string GlobalResponse { get; set; }
  47. }
  48. }