IHttpServer.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. /// Gets the local end points.
  29. /// </summary>
  30. /// <value>The local end points.</value>
  31. IEnumerable<string> LocalEndPoints { get; }
  32. /// <summary>
  33. /// Stops this instance.
  34. /// </summary>
  35. void Stop();
  36. /// <summary>
  37. /// Occurs when [web socket connected].
  38. /// </summary>
  39. event EventHandler<WebSocketConnectEventArgs> WebSocketConnected;
  40. /// <summary>
  41. /// Occurs when [web socket connecting].
  42. /// </summary>
  43. event EventHandler<WebSocketConnectingEventArgs> WebSocketConnecting;
  44. /// <summary>
  45. /// Inits this instance.
  46. /// </summary>
  47. void Init(IEnumerable<IRestfulService> services);
  48. }
  49. }