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
56 instantiations of ListenOptions
InMemory.FunctionalTests (28)
ConnectionLimitTests.cs (1)
237var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
ConnectionMiddlewareTests.cs (8)
39var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 135var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 158var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 184var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 211var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 243var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 271var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 302var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
HttpProtocolSelectionTests.cs (2)
62var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 81var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
KestrelMetricsTests.cs (5)
46var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 109var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 323var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 441var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 493var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
ResponseDrainingTests.cs (2)
17new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)), 18new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)).UsePassThrough()
ResponseTests.cs (8)
4565options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4598options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4635options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4666new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) { Protocols = HttpProtocols.Http1 })) 4693options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4697options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 1)) 4733options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4884options => options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))),
TestTransport\TestServer.cs (2)
44: this(app, context, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))) 57var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
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))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
KestrelServerTests.cs (4)
545new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 602new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 662new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 724new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
ListenOptionsTests.cs (2)
18var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 71var listenOptions = new ListenOptions(new UriEndPoint(new Uri("http://127.0.0.1:5555")));
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (2)
35: this(app, context, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))) 47var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
Sockets.FunctionalTests (12)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (2)
35: this(app, context, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))) 47var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (2)
21var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 51var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (1)
37new ListenOptions((ulong)_canListenToOpenTcpSocketHandleSocket.Handle)))
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
51{ "Loopback", () => new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) }, 52{ "PassThrough", () => new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)).UsePassThrough() }
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (5)
38new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)), 39new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)).UsePassThrough() 876var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 953var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 1040var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
323 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)
InMemory.FunctionalTests (69)
ConnectionLimitTests.cs (1)
237var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
ConnectionMiddlewareTests.cs (8)
39var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 135var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 158var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 184var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 211var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 243var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 271var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 302var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
HttpProtocolSelectionTests.cs (2)
62var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 81var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
HttpsConnectionMiddlewareTests.cs (45)
53void ConfigureListenOptions(ListenOptions listenOptions) 86void ConfigureListenOptions(ListenOptions listenOptions) 107void ConfigureListenOptions(ListenOptions listenOptions) 130void ConfigureListenOptions(ListenOptions listenOptions) 170void ConfigureListenOptions(ListenOptions listenOptions) 210void ConfigureListenOptions(ListenOptions listenOptions) 252void ConfigureListenOptions(ListenOptions listenOptions) 286void ConfigureListenOptions(ListenOptions listenOptions) 311void ConfigureListenOptions(ListenOptions listenOptions) 373void ConfigureListenOptions(ListenOptions listenOptions) 398void ConfigureListenOptions(ListenOptions listenOptions) 426Assert.Throws<ArgumentException>(() => CreateMiddleware(new HttpsConnectionAdapterOptions(), ListenOptions.DefaultHttpProtocols)); 432void ConfigureListenOptions(ListenOptions listenOptions) 452void ConfigureListenOptions(ListenOptions listenOptions) 483void ConfigureListenOptions(ListenOptions listenOptions) 516void ConfigureListenOptions(ListenOptions listenOptions) 558void ConfigureListenOptions(ListenOptions listenOptions) 588void ConfigureListenOptions(ListenOptions listenOptions) 620void ConfigureListenOptions(ListenOptions listenOptions) 651void ConfigureListenOptions(ListenOptions listenOptions) 687void ConfigureListenOptions(ListenOptions listenOptions) 731void ConfigureListenOptions(ListenOptions listenOptions) 772void ConfigureListenOptions(ListenOptions listenOptions) 813void ConfigureListenOptions(ListenOptions listenOptions) 857void ConfigureListenOptions(ListenOptions listenOptions) 905void ConfigureListenOptions(ListenOptions listenOptions) 974void ConfigureListenOptions(ListenOptions listenOptions) 1029void ConfigureListenOptions(ListenOptions listenOptions) 1071static void ConfigureListenOptions(ListenOptions listenOptions) 1099static void ConfigureListenOptions(ListenOptions listenOptions) 1131static void ConfigureListenOptions(ListenOptions listenOptions) 1166void ConfigureListenOptions(ListenOptions listenOptions) 1213void ConfigureListenOptions(ListenOptions listenOptions) 1265void ConfigureListenOptions(ListenOptions listenOptions) 1280void ConfigureListenOptions(ListenOptions listenOptions) 1315void ConfigureListenOptions(ListenOptions listenOptions) 1348void ConfigureListenOptions(ListenOptions listenOptions) 1374void ConfigureListenOptions(ListenOptions listenOptions) 1397void ConfigureListenOptions(ListenOptions listenOptions) 1422void ConfigureListenOptions(ListenOptions listenOptions) 1481ListenOptions.DefaultHttpProtocols); 1501ListenOptions.DefaultHttpProtocols)); 1521ListenOptions.DefaultHttpProtocols, 1535void ConfigureListenOptions(ListenOptions listenOptions) 1622ListenOptions.DefaultHttpProtocols);
KestrelMetricsTests.cs (5)
46var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 109var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 323var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 441var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 493var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
ResponseDrainingTests.cs (3)
15public static TheoryData<ListenOptions> ConnectionMiddlewareData => new TheoryData<ListenOptions> 23public async Task ConnectionClosedWhenResponseNotDrainedAtMinimumDataRate(ListenOptions listenOptions)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (2)
111Func<ListenOptions, Task> createBinding) 126Func<ListenOptions, CancellationToken, Task> createBinding)
TestTransport\TestServer.cs (3)
49public TestServer(RequestDelegate app, TestServiceContext context, ListenOptions listenOptions) 54public TestServer(RequestDelegate app, TestServiceContext context, Action<ListenOptions> configureListenOptions) 57var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
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,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (23)
AddressBinderTests.cs (14)
19private readonly Func<ListenOptions, ListenOptions> _noopUseHttps = l => l; 58var listenOptions = AddressBinder.ParseAddress($"http://{host}", out var https); 82var listenOptions = AddressBinder.ParseAddress($"http://*:80", out var https); 99var listenOptions = AddressBinder.ParseAddress("http://localhost", out var https); 117var listenOptions = AddressBinder.ParseAddress(address, out var https); 135var listenOptions = AddressBinder.ParseAddress("http://pipe:8080", out var https); 145var listenOptions = AddressBinder.ParseAddress(address, out var https); 156var listenOptions = AddressBinder.ParseAddress(address, out var https); 167var listenOptions = AddressBinder.ParseAddress(address, out var https); 178var listenOptions = AddressBinder.ParseAddress("http://unix:/tmp/kestrel-test.sock", out var https); 189var listenOptions = AddressBinder.ParseAddress(@"http://unix:/c:/foo/bar/pipe.socket", out var https); 203var listenOptions = AddressBinder.ParseAddress(address, out var https); 355var endpoints = new List<ListenOptions>();
KestrelServerOptionsTests.cs (1)
31Assert.Equal(ListenOptions.DefaultHttpProtocols, options.CodeBackedListenOptions[0].Protocols);
ListenOptionsTests.cs (6)
18var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 19Assert.Equal(ListenOptions.DefaultHttpProtocols, listenOptions.Protocols); 38var clone = localhostListenOptions.Clone(IPAddress.IPv6Loopback); 56var clone1 = localhostListenOptions.Clone(IPAddress.IPv6Loopback); 63var clone2 = localhostListenOptions.Clone(IPAddress.IPv6Loopback); 71var listenOptions = new ListenOptions(new UriEndPoint(new Uri("http://127.0.0.1:5555")));
src\Servers\Kestrel\shared\test\TestContextFactory.cs (2)
111Func<ListenOptions, Task> createBinding) 126Func<ListenOptions, CancellationToken, Task> createBinding)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (2)
111Func<ListenOptions, Task> createBinding) 126Func<ListenOptions, CancellationToken, Task> createBinding)
Microsoft.AspNetCore.Server.Kestrel.Tests (12)
KestrelConfigurationLoaderTests.cs (12)
431var listenOptions = Assert.Single(serverOptions.ConfigurationBackedListenOptions); 470var listenOptions = serverOptions.CodeBackedListenOptions.Single(); 519var listenOptions = serverOptions.CodeBackedListenOptions.Single(); 570var listenOptions = serverOptions.CodeBackedListenOptions.Single(); 1101var end1 = Assert.Single(endpointsToStart); 1395Assert.Equal(ListenOptions.DefaultHttpProtocols, opt.Protocols); 1425Assert.Equal(ListenOptions.DefaultHttpProtocols, opt.Protocols); 1432Assert.Equal(ListenOptions.DefaultHttpProtocols, opt.Protocols); 1641var end1 = Assert.Single(endpointsToStart); 1801var stopEndpoint = Assert.Single(endpointsToStop); 1802var startEndpoint = Assert.Single(endpointsToStart); 1805Assert.Equal(ListenOptions.DefaultHttpProtocols, stopEndpoint.Protocols);
Sockets.BindTests (4)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (4)
26private ListenOptions _listenOptions; 39public TestServer(RequestDelegate app, TestServiceContext context, ListenOptions listenOptions) 44public TestServer(RequestDelegate app, TestServiceContext context, Action<ListenOptions> configureListenOptions, Action<IServiceCollection> configureServices = null) 47var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
Sockets.FunctionalTests (19)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (4)
26private ListenOptions _listenOptions; 39public TestServer(RequestDelegate app, TestServiceContext context, ListenOptions listenOptions) 44public TestServer(RequestDelegate app, TestServiceContext context, Action<ListenOptions> configureListenOptions, Action<IServiceCollection> configureServices = null) 47var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (2)
21var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 51var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
49public static Dictionary<string, Func<ListenOptions>> ConnectionMiddlewareData { get; } = new Dictionary<string, Func<ListenOptions>>
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (11)
36public static TheoryData<ListenOptions> ConnectionMiddlewareData => new TheoryData<ListenOptions> 148public async Task WriteAfterConnectionCloseNoops(ListenOptions listenOptions) 191public async Task ThrowsOnWriteWithRequestAbortedTokenAfterRequestIsAborted(ListenOptions listenOptions) 261public async Task WritingToConnectionAfterUnobservedCloseTriggersRequestAbortedToken(ListenOptions listenOptions) 352public async Task AppCanHandleClientAbortingConnectionMidResponse(ListenOptions listenOptions) 423public async Task ClientAbortingConnectionImmediatelyIsNotLoggedHigherThanDebug(ListenOptions listenOptions) 654void ConfigureListenOptions(ListenOptions listenOptions) 876var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 953var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 1040var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));