2 types derived from ListenOptions
Microsoft.AspNetCore.Server.Kestrel.Core (2)
AnyIPListenOptions.cs (1)
12internal sealed class AnyIPListenOptions : ListenOptions
LocalhostListenOptions.cs (1)
10internal sealed class LocalhostListenOptions : ListenOptions
8 instantiations of ListenOptions
Microsoft.AspNetCore.Server.Kestrel.Core (8)
Internal\AddressBinder.cs (3)
122options = new ListenOptions(parsedAddress.UnixPipePath); 126options = new ListenOptions(new NamedPipeEndPoint(parsedAddress.NamedPipeName)); 135options = new ListenOptions(endpoint);
KestrelServerOptions.cs (4)
527var listenOptions = new ListenOptions(endPoint); 593var listenOptions = new ListenOptions(socketPath); 615var listenOptions = new ListenOptions(handle); 638var listenOptions = new ListenOptions(new NamedPipeEndPoint(pipeName));
ListenOptions.cs (1)
236var options = new ListenOptions(new IPEndPoint(address, IPEndPoint!.Port))
194 references to ListenOptions
Aspire.Dashboard (1)
Authentication\Connection\ListenOptionsConnectionTypeExtensions.cs (1)
10public static void UseConnectionTypes(this ListenOptions listenOptions, IEnumerable<ConnectionType> connectionTypes)
Aspire.Dashboard.Tests (1)
Integration\DashboardClientAuthTests.cs (1)
94void ConfigureListen(ListenOptions options)
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
164void ConfigureListen(ListenOptions options)
Microsoft.AspNetCore.Server.Kestrel.Core (191)
EndpointConfiguration.cs (2)
15internal EndpointConfiguration(bool isHttps, ListenOptions listenOptions, HttpsConnectionAdapterOptions httpsOptions, IConfigurationSection configSection) 31public ListenOptions ListenOptions { get; }
HttpsConfigurationService.cs (11)
27private Action<FeatureCollection, ListenOptions, ILogger<HttpsConnectionMiddleware>>? _populateMultiplexedTransportFeatures; 28private Func<ListenOptions, ListenOptions>? _useHttpsWithDefaults; 88public ListenOptions UseHttpsWithSni(ListenOptions listenOptions, HttpsConnectionAdapterOptions httpsOptions, EndpointConfig endpoint) 103public void PopulateMultiplexedTransportFeatures(FeatureCollection features, ListenOptions listenOptions) 110public ListenOptions UseHttpsWithDefaults(ListenOptions listenOptions) 144internal static void PopulateMultiplexedTransportFeaturesWorker(FeatureCollection features, ListenOptions listenOptions, ILogger<HttpsConnectionMiddleware> logger) 181internal static ListenOptions UseHttpsWithDefaultsWorker(ListenOptions listenOptions)
IHttpsConfigurationService.cs (9)
50/// Calls an appropriate overload of <see cref="Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions)"/> 53/// <returns>Updated <see cref="ListenOptions"/> for convenient chaining.</returns> 57ListenOptions UseHttpsWithSni(ListenOptions listenOptions, HttpsConnectionAdapterOptions httpsOptions, EndpointConfig endpoint); 74void PopulateMultiplexedTransportFeatures(FeatureCollection features, ListenOptions listenOptions); 77/// Calls <see cref="Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions)"/> 80/// <returns>Updated <see cref="ListenOptions"/> for convenient chaining.</returns> 84ListenOptions UseHttpsWithDefaults(ListenOptions listenOptions);
Internal\AddressBindContext.cs (2)
14Func<ListenOptions, CancellationToken, Task> createBinding) 28public Func<ListenOptions, CancellationToken, Task> CreateBinding { get; }
Internal\AddressBinder.cs (21)
19public static Task BindAsync(ListenOptions[] listenOptions, AddressBindContext context, Func<ListenOptions, ListenOptions> useHttps, CancellationToken cancellationToken) 35private static IStrategy CreateStrategy(ListenOptions[] listenOptions, string[] addresses, bool preferAddresses, Func<ListenOptions, ListenOptions> useHttps) 86internal static async Task BindEndpointAsync(ListenOptions endpoint, AddressBindContext context, CancellationToken cancellationToken) 100internal static ListenOptions ParseAddress(string address, out bool https) 119ListenOptions? options = null; 177var httpDefault = ParseAddress(Constants.DefaultServerAddress, out _); 190public OverrideWithAddressesStrategy(IReadOnlyCollection<string> addresses, Func<ListenOptions, ListenOptions> useHttps) 211public OverrideWithEndpointsStrategy(IReadOnlyCollection<ListenOptions> endpoints, string[] originalAddresses) 230private readonly IReadOnlyCollection<ListenOptions> _endpoints; 232public EndpointsStrategy(IReadOnlyCollection<ListenOptions> endpoints) 239foreach (var endpoint in _endpoints) 249private readonly Func<ListenOptions, ListenOptions> _useHttps; 251public AddressesStrategy(IReadOnlyCollection<string> addresses, Func<ListenOptions, ListenOptions> useHttps) 261var options = ParseAddress(address, out var https);
Internal\ConfigurationReader.cs (6)
305(Protocols ?? ListenOptions.DefaultHttpProtocols) == (other.Protocols ?? ListenOptions.DefaultHttpProtocols) && 313Protocols ?? ListenOptions.DefaultHttpProtocols, SslProtocols ?? System.Security.Authentication.SslProtocols.None, 347(Protocols ?? ListenOptions.DefaultHttpProtocols) == (other.Protocols ?? ListenOptions.DefaultHttpProtocols) && 353Protocols ?? ListenOptions.DefaultHttpProtocols, SslProtocols ?? System.Security.Authentication.SslProtocols.None,
Internal\Infrastructure\TransportManager.cs (1)
64public async Task<EndPoint> BindAsync(EndPoint endPoint, MultiplexedConnectionDelegate multiplexedConnectionDelegate, ListenOptions listenOptions, CancellationToken cancellationToken)
Internal\KestrelServerImpl.cs (4)
139async Task OnBind(ListenOptions options, CancellationToken onBindCancellationToken) 367foreach (var lo in endpointsToStop) 373foreach (var listenOption in endpointsToStop) 388foreach (var listenOption in endpointsToStart)
KestrelConfigurationLoader.cs (17)
101public KestrelConfigurationLoader Endpoint(IPAddress address, int port, Action<ListenOptions> configure) 116public KestrelConfigurationLoader Endpoint(IPEndPoint endPoint, Action<ListenOptions> configure) 139public KestrelConfigurationLoader LocalhostEndpoint(int port, Action<ListenOptions> configure) 159public KestrelConfigurationLoader AnyIPEndpoint(int port, Action<ListenOptions> configure) 179public KestrelConfigurationLoader UnixSocketEndpoint(string socketPath, Action<ListenOptions> configure) 204public KestrelConfigurationLoader NamedPipeEndpoint(string pipeName, Action<ListenOptions> configure) 225public KestrelConfigurationLoader HandleEndpoint(ulong handle, Action<ListenOptions> configure) 239internal void ApplyEndpointDefaults(ListenOptions listenOptions) 335internal (List<ListenOptions>, List<ListenOptions>) Reload() 343var endpointsToStart = new List<ListenOptions>(); 344var endpointsToReuse = new List<ListenOptions>(); 363var listenOptions = AddressBinder.ParseAddress(endpoint.Url, out var https); 394var matchingBoundEndpoints = new List<ListenOptions>(); 395foreach (var o in endpointsToStop) 457foreach (var endpointToStart in endpointsToStart) 481foreach (var endpointToStop in endpointsToStop)
KestrelServer.cs (5)
89public void PopulateMultiplexedTransportFeatures(FeatureCollection features, ListenOptions listenOptions) 94public ListenOptions UseHttpsWithDefaults(ListenOptions listenOptions) 109public ListenOptions UseHttpsWithSni(ListenOptions listenOptions, HttpsConnectionAdapterOptions httpsOptions, EndpointConfig endpoint)
KestrelServerOptions.cs (28)
74internal List<ListenOptions> CodeBackedListenOptions { get; } = new List<ListenOptions>(); 75internal List<ListenOptions> ConfigurationBackedListenOptions { get; } = new List<ListenOptions>(); 77internal ListenOptions[] GetListenOptions() 82return Array.Empty<ListenOptions>(); 85var result = new ListenOptions[resultCount]; 92internal List<ListenOptions> OptionsInUse { get; } = new List<ListenOptions>(); 151[Obsolete($"This property is obsolete and will be removed in a future version. It no longer has any impact on runtime behavior. Use {nameof(Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions)}.{nameof(Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.DisableAltSvcHeader)} to configure \"Alt-Svc\" behavior.", error: true)] 194private Action<ListenOptions> EndpointDefaults { get; set; } = _ => { }; 259public void ConfigureEndpointDefaults(Action<ListenOptions> configureOptions) 264internal void ApplyEndpointDefaults(ListenOptions listenOptions) 364writer.WritePropertyName(nameof(ListenOptions)); 366foreach (var listenOptions in OptionsInUse) 485public void Listen(IPAddress address, int port, Action<ListenOptions> configure) 513public void Listen(IPEndPoint endPoint, Action<ListenOptions> configure) 522public void Listen(EndPoint endPoint, Action<ListenOptions> configure) 527var listenOptions = new ListenOptions(endPoint); 543public void ListenLocalhost(int port, Action<ListenOptions> configure) 561public void ListenAnyIP(int port, Action<ListenOptions> configure) 583public void ListenUnixSocket(string socketPath, Action<ListenOptions> configure) 593var listenOptions = new ListenOptions(socketPath); 611public void ListenHandle(ulong handle, Action<ListenOptions> configure) 615var listenOptions = new ListenOptions(handle); 633public void ListenNamedPipe(string pipeName, Action<ListenOptions> configure) 638var listenOptions = new ListenOptions(new NamedPipeEndPoint(pipeName));
ListenOptions.cs (7)
58/// Only set if the <see cref="ListenOptions"/> is bound to a <see cref="System.Net.IPEndPoint"/>. 66/// Only set if the <see cref="ListenOptions"/> is bound to a <see cref="UnixDomainSocketEndPoint"/>. 74/// Only set if the <see cref="ListenOptions"/> is bound to a <see cref="NamedPipeEndPoint"/>. 82/// Only set if the <see cref="ListenOptions"/> is bound to a <see cref="FileHandleEndPoint"/>. 169/// Configured by the <c>UseHttps()</c> and <see cref="Hosting.ListenOptionsConnectionLoggingExtensions.UseConnectionLogging(ListenOptions)"/> 234protected internal ListenOptions Clone(IPAddress address) 236var options = new ListenOptions(new IPEndPoint(address, IPEndPoint!.Port))
ListenOptionsHttpsExtensions.cs (65)
21/// Extension methods for <see cref="ListenOptions"/> that configure Kestrel to use HTTPS for a given endpoint. 29/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 30/// <returns>The <see cref="ListenOptions"/>.</returns> 31public static ListenOptions UseHttps(this ListenOptions listenOptions) => listenOptions.UseHttps(_ => { }); 36/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 39/// <returns>The <see cref="ListenOptions"/>.</returns> 40public static ListenOptions UseHttps(this ListenOptions listenOptions, string fileName) 49/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 53/// <returns>The <see cref="ListenOptions"/>.</returns> 54public static ListenOptions UseHttps(this ListenOptions listenOptions, string fileName, string? password) 63/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 67/// <returns>The <see cref="ListenOptions"/>.</returns> 68public static ListenOptions UseHttps(this ListenOptions listenOptions, string fileName, string? password, 78/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 81/// <returns>The <see cref="ListenOptions"/>.</returns> 82public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject) 88/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 92/// <returns>The <see cref="ListenOptions"/>.</returns> 93public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid) 99/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 104/// <returns>The <see cref="ListenOptions"/>.</returns> 105public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location) 111/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 117/// <returns>The <see cref="ListenOptions"/>.</returns> 118public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location, 127/// <param name="listenOptions"> The <see cref="ListenOptions"/> to configure.</param> 129/// <returns>The <see cref="ListenOptions"/>.</returns> 130public static ListenOptions UseHttps(this ListenOptions listenOptions, X509Certificate2 serverCertificate) 143/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 146/// <returns>The <see cref="ListenOptions"/>.</returns> 147public static ListenOptions UseHttps(this ListenOptions listenOptions, X509Certificate2 serverCertificate, 163/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 165/// <returns>The <see cref="ListenOptions"/>.</returns> 166public static ListenOptions UseHttps(this ListenOptions listenOptions, Action<HttpsConnectionAdapterOptions> configureOptions) 193/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 195/// <returns>The <see cref="ListenOptions"/>.</returns> 196public static ListenOptions UseHttps(this ListenOptions listenOptions, HttpsConnectionAdapterOptions httpsOptions) 217/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 220/// <returns>The <see cref="ListenOptions"/>.</returns> 221public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state) 230/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 234/// <returns>The <see cref="ListenOptions"/>.</returns> 235public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state, TimeSpan handshakeTimeout) 249/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 251/// <returns>The <see cref="ListenOptions"/>.</returns> 252public static ListenOptions UseHttps(this ListenOptions listenOptions, TlsHandshakeCallbackOptions callbackOptions) 289/// <param name="listenOptions">The <see cref="ListenOptions"/> to configure.</param> 303/// <returns>The <see cref="ListenOptions"/>.</returns> 304public static ListenOptions UseTlsClientHelloListener(this ListenOptions listenOptions, Action<ConnectionContext, ReadOnlySequence<byte>> tlsClientHelloBytesCallback, TimeSpan? timeout = null)
LocalhostListenOptions.cs (2)
44var v4Options = Clone(IPAddress.Loopback); 58var v6Options = Clone(IPAddress.IPv6Loopback);
Middleware\ListenOptionsConnectionLoggingExtensions.cs (6)
21/// The <see cref="ListenOptions"/>. 23public static ListenOptions UseConnectionLogging(this ListenOptions listenOptions) 32/// The <see cref="ListenOptions"/>. 34public static ListenOptions UseConnectionLogging(this ListenOptions listenOptions, string? loggerName)
Systemd\KestrelServerOptionsSystemdExtensions.cs (1)
37public static KestrelServerOptions UseSystemd(this KestrelServerOptions options, Action<ListenOptions> configure)
TlsConfigurationLoader.cs (4)
88/// Calls an appropriate overload of <see cref="Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions)"/> 91/// <returns>Updated <see cref="ListenOptions"/> for convenient chaining.</returns> 92public ListenOptions UseHttpsWithSni( 93ListenOptions listenOptions,