Class HttpServer
Provides an HTTP server that can be shared among multiple HTTP-based streaming servers.
public class HttpServer
- Inheritance
-
HttpServer
- Inherited Members
Constructors
HttpServer(Type, HttpListener, List<int>, List<int>)
Creates new instance of HttpServer class. At least one port must be set to non-zero value.
public HttpServer(HttpServer.Type serverType, HttpListener httpListener = null, List<int> httpPorts = null, List<int> httpsPorts = null)
Parameters
serverTypeHttpServer.TypeHTTP server type. It could be either fully fledged server or simple dispatcher in case of ASP.NET Core.
httpListenerHttpListenerHTTP listener object.
httpPortsList<int>HTTP ports to start listening on. Must be set to null to disable HTTP listener.
httpsPortsList<int>HTTPS ports to start listening on. Must be set to null to disable HTTPS listener.
HttpServer(Type, HttpListener, int, int)
Creates new instance of HttpServer class. At least one port must be set to non-zero value.
public HttpServer(HttpServer.Type serverType, HttpListener httpListener = null, int httpPort = 80, int httpsPort = 443)
Parameters
serverTypeHttpServer.TypeHTTP server type. It could be either fully fledged server or simple dispatcher in case of ASP.NET Core.
httpListenerHttpListenerHTTP listener object.
httpPortintHTTP port to start listening on. Must be set to 0 to disable HTTP listener.
httpsPortintHTTPS port to start listening on. Must be set to 0 to disable HTTPS listener.
HttpServer(Type, HttpListener, HttpServerParameters)
Creates new instance of HttpServer class. At least one port must be set to non-zero value.
public HttpServer(HttpServer.Type serverType, HttpListener httpListener = null, HttpServerParameters parameters = null)
Parameters
serverTypeHttpServer.TypeHTTP server type. It could be either fully fledged server or simple dispatcher in case of ASP.NET Core.
httpListenerHttpListenerHTTP listener object.
parametersHttpServerParametersHTTP server parameters.
Methods
DispatchRequest(IHttpRequestContext)
Dispatches a received HTTP request to the appropriate registered handler.
public Task DispatchRequest(IHttpRequestContext context)
Parameters
contextIHttpRequestContextThe HTTP request context to dispatch.
Returns
- Task
A task representing the asynchronous dispatch operation.
Start()
Starts the HTTP server and begins listening for requests.
public void Start()
Stop()
Stops the HTTP server and releases all resources.
public void Stop()