IHttpServer.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /// <summary>
  49. /// If set, all requests will respond with this message
  50. /// </summary>
  51. string GlobalResponse { get; set; }
  52. }
  53. }