Share via


KestrelServerOptions Class

Definition

Provides programmatic configuration of Kestrel-specific features.

public ref class KestrelServerOptions
public class KestrelServerOptions
type KestrelServerOptions = class
Public Class KestrelServerOptions
Inheritance
KestrelServerOptions

Constructors

KestrelServerOptions()

Properties

AddServerHeader

Gets or sets whether the Server header should be included in each response.

ApplicationServices

Enables the UseKestrel options callback to resolve and use services registered by the application during startup. Typically initialized by UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>).

ConnectionFilter

Gets or sets an IConnectionFilter that allows each connection Stream to be intercepted and transformed. Configured by the UseHttps() and UseConnectionLogging(KestrelServerOptions) extension methods.

Limits

Provides access to request limit options.

MaxRequestBufferSize
Obsolete.

This property is obsolete and will be removed in a future version. Use Limits.MaxRequestBufferSize instead.

Gets or sets the maximum size of the request buffer.

NoDelay

Set to false to enable Nagle's algorithm for all connections.

ShutdownTimeout

The amount of time after the server begins shutting down before connections will be forcefully closed. Kestrel will wait for the duration of the timeout for any ongoing request processing to complete before terminating the connection. No new connections or requests will be accepted during this time.

ThreadCount

The number of libuv I/O threads used to process requests.

Extension Methods

UseConnectionLogging(KestrelServerOptions, String)

Emits verbose logs for bytes read from and written to the connection.

UseConnectionLogging(KestrelServerOptions)

Emits verbose logs for bytes read from and written to the connection.

UseHttps(KestrelServerOptions, HttpsConnectionFilterOptions)

Configure Kestrel to use HTTPS.

UseHttps(KestrelServerOptions, X509Certificate2)

Configure Kestrel to use HTTPS.

UseHttps(KestrelServerOptions, String, String)

Configure Kestrel to use HTTPS.

UseHttps(KestrelServerOptions, String)

Configure Kestrel to use HTTPS.

Applies to