Table of Contents

Class HttpServer

Namespace
VAST.HTTP
Assembly
VAST.Common.dll

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

serverType HttpServer.Type

HTTP server type. It could be either fully fledged server or simple dispatcher in case of ASP.NET Core.

httpListener HttpListener

HTTP listener object.

httpPorts List<int>

HTTP ports to start listening on. Must be set to null to disable HTTP listener.

httpsPorts List<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

serverType HttpServer.Type

HTTP server type. It could be either fully fledged server or simple dispatcher in case of ASP.NET Core.

httpListener HttpListener

HTTP listener object.

httpPort int

HTTP port to start listening on. Must be set to 0 to disable HTTP listener.

httpsPort int

HTTPS 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

serverType HttpServer.Type

HTTP server type. It could be either fully fledged server or simple dispatcher in case of ASP.NET Core.

httpListener HttpListener

HTTP listener object.

parameters HttpServerParameters

HTTP server parameters.

Methods

DispatchRequest(IHttpRequestContext)

Dispatches a received HTTP request to the appropriate registered handler.

public Task DispatchRequest(IHttpRequestContext context)

Parameters

context IHttpRequestContext

The 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()