Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Servers.HttpServerOptions

Summary

Contains configuration settings for an HttpServer.

Constructors

Creates a new instance of HttpServerOptions.

Instance methods

HttpServerOptions
AddEndpoint(string key, HttpEndpoint endpoint)
Adds an endpoint for the server to listen on.
HttpServerOptions
AddEndpoint(string key, string bindAddress, int port, bool secure = false)
void Throws an exception if the settings are invalid. (see also remarks)
bool
RemoveEndpoint(string key)
Removes an endpoint from this option class.

Instance properties

IDictionary<string, HttpEndpoint> A readonly dictionary of added server endpoints. See HttpServerOptions.AddEndpoint(string, string, int, bool), HttpServerOptions.AddEndpoint(string, HttpEndpoint) and [Unrecognized tag: "seealso"] for adding and removing things from this list.

Instance fields

HttpServerCertificateInfo Specifies the default X509 certificate to use in HTTPS. Use HttpServerOptions.Certificates to override this for specific domain names. HttpServerOptions.CertificateResolver takes precedence over this.
Func<string, X509Certificate2> A function which returns a certificate based on a host name (SNI). The input is null if the client does not specify a host name in the TLS hello packet. If specified, this takes precendence over both HttpServerOptions.Certificates and HttpServerOptions.Certificate. Return null to fall back to HttpServerOptions.Certificates and HttpServerOptions.Certificate.
Dictionary<string, HttpServerCertificateInfo> Specifies the X509 certificates to use for specific domain names. HttpServerOptions.CertificateResolver takes precedence over this.
stringContent-Type to return when handler provides none. Default is "text/html; charset=utf-8".
int If a file is larger than this, then the server will read a chunk from the middle of the file and gzip it to determine whether gzipping the whole file is worth it. Otherwise it will default to using gzip either way.
long The maximum size (in bytes) of a response at which the server will gzip the entire content in-memory (assuming gzip is requested in the HTTP request). Default is 1 MB. Content larger than this size will be gzipped in chunks (if requested).
intTimeout in milliseconds for idle connections. Set to 0 for no timeout. Default is 10000 (10 seconds).
intMaximum allowed size for the headers of a request, in bytes. Default is 256 KB.
longMaximum allowed size for the content of a POST/PUT/PATCH request, in bytes. Default is 1 GB.
bool Determines whether the default error handler outputs exception information (including a stack trace) to the client (browser) as HTML. The default error handler always outputs the HTTP status code description. It is invoked when HttpServer.ErrorHandler is null or throws an exception.
long The maximum size (in bytes) at which file uploads in a POST/PUT/PATCH request are stored in memory. Any uploads that exceed this limit are written to temporary files on disk. Default is 16 MB.
string The temporary directory to use for file uploads in POST/PUT/PATCH requests. Default is Path.GetTempPath.