KestrelServerOptions KestrelServerOptions KestrelServerOptions Class

Definition

Provides programmatic configuration of Kestrel-specific features.

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

Constructors

KestrelServerOptions() KestrelServerOptions() KestrelServerOptions()

Properties

AddServerHeader AddServerHeader AddServerHeader

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

AllowSynchronousIO AllowSynchronousIO AllowSynchronousIO

Gets or sets a value that controls whether synchronous IO is allowed for the Request and Response

ApplicationSchedulingMode ApplicationSchedulingMode ApplicationSchedulingMode

Gets or sets a value that determines how Kestrel should schedule user callbacks.

ApplicationServices ApplicationServices ApplicationServices

Enables the Listen options callback to resolve and use services registered by the application during startup. Typically initialized by UseKestrel()"/>.

ConfigurationLoader ConfigurationLoader ConfigurationLoader

Provides a configuration source where endpoints will be loaded from on server start. The default is null.

Limits Limits Limits

Provides access to request limit options.

Methods

Configure() Configure() Configure()

Creates a configuration loader for setting up Kestrel.

Configure(IConfiguration) Configure(IConfiguration) Configure(IConfiguration)

Creates a configuration loader for setting up Kestrel that takes an IConfiguration as input. This configuration must be scoped to the configuration section for Kestrel.

ConfigureEndpointDefaults(Action<ListenOptions>) ConfigureEndpointDefaults(Action<ListenOptions>) ConfigureEndpointDefaults(Action<ListenOptions>)

Specifies a configuration Action to run for each newly created endpoint. Calling this again will replace the prior action.

ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>) ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>) ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)

Specifies a configuration Action to run for each newly created https endpoint. Calling this again will replace the prior action.

Listen(IPAddress, Int32, Action<ListenOptions>) Listen(IPAddress, Int32, Action<ListenOptions>) Listen(IPAddress, Int32, Action<ListenOptions>)

Bind to given IP address and port. The callback configures endpoint-specific settings.

Listen(IPEndPoint, Action<ListenOptions>) Listen(IPEndPoint, Action<ListenOptions>) Listen(IPEndPoint, Action<ListenOptions>)

Bind to given IP address and port. The callback configures endpoint-specific settings.

Listen(IPEndPoint) Listen(IPEndPoint) Listen(IPEndPoint)

Bind to given IP endpoint.

Listen(IPAddress, Int32) Listen(IPAddress, Int32) Listen(IPAddress, Int32)

Bind to given IP address and port.

ListenAnyIP(Int32) ListenAnyIP(Int32) ListenAnyIP(Int32)

Listens on all IPs using IPv6 [::], or IPv4 0.0.0.0 if IPv6 is not supported.

ListenAnyIP(Int32, Action<ListenOptions>) ListenAnyIP(Int32, Action<ListenOptions>) ListenAnyIP(Int32, Action<ListenOptions>)

Listens on all IPs using IPv6 [::], or IPv4 0.0.0.0 if IPv6 is not supported.

ListenHandle(UInt64) ListenHandle(UInt64) ListenHandle(UInt64)

Open a socket file descriptor.

ListenHandle(UInt64, Action<ListenOptions>) ListenHandle(UInt64, Action<ListenOptions>) ListenHandle(UInt64, Action<ListenOptions>)

Open a socket file descriptor. The callback configures endpoint-specific settings.

ListenLocalhost(Int32) ListenLocalhost(Int32) ListenLocalhost(Int32)

Listens on ::1 and 127.0.0.1 with the given port. Requesting a dynamic port by specifying 0 is not supported for this type of endpoint.

ListenLocalhost(Int32, Action<ListenOptions>) ListenLocalhost(Int32, Action<ListenOptions>) ListenLocalhost(Int32, Action<ListenOptions>)

Listens on ::1 and 127.0.0.1 with the given port. Requesting a dynamic port by specifying 0 is not supported for this type of endpoint.

ListenUnixSocket(String) ListenUnixSocket(String) ListenUnixSocket(String)

Bind to given Unix domain socket path.

ListenUnixSocket(String, Action<ListenOptions>) ListenUnixSocket(String, Action<ListenOptions>) ListenUnixSocket(String, Action<ListenOptions>)

Bind to given Unix domain socket path. Specify callback to configure endpoint-specific settings.

Extension Methods

UseSystemd(KestrelServerOptions) UseSystemd(KestrelServerOptions) UseSystemd(KestrelServerOptions)

Open file descriptor (SD_LISTEN_FDS_START) initialized by systemd socket-based activation logic if available.

UseSystemd(KestrelServerOptions, Action<ListenOptions>) UseSystemd(KestrelServerOptions, Action<ListenOptions>) UseSystemd(KestrelServerOptions, Action<ListenOptions>)

Open file descriptor (SD_LISTEN_FDS_START) initialized by systemd socket-based activation logic if available. Specify callback to configure endpoint-specific settings.

Applies to