This repository has been archived by the owner on Dec 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 527
Create a direct way to configure endpoints on Kestrel #996
Comments
@davidfowl to schedule an api design meeting |
@shirhatti let's get this designed for 1.1.0 ASAP pls |
Are we willing to change the design/behavior of |
WebListener already has |
Based on our ( @davidfowl @Tratcher @halter73 @CesarBS ) design meeting yesterday, we made a couple of decisions. Some of these might be obvious but it's still worth explicitly calling out.
var host = new WebHostBuilder()
.UseKestrel(options =>
{
// Easy mode (http only)
options.Listen(IPAddress.Any, 80);
// Verbose
options.Listen(IPAddress.Any, 443, listenOptions =>
{
// Enable https
listenOptions.UseHttps("server.pfx");
});
})
.UseStartup<Startup>()
.Build();
host.Run();
var host = new WebHostBuilder()
.UseKestrel(options =>
{
// Easy mode
options.ListenUnixSocket("/tmp/kestrel-test.sock");
// Verbose
options.ListenUnixSocket("/tmp/kestrel-test.sock", listenOptions =>
{
listenOptions.UseHttps("server.pfx");
});
})
.UseStartup<Startup>()
.Build();
host.Run();
var host = new WebHostBuilder()
.UseKestrel(options =>
{
var fds = Environment.GetEnvironment("SD_LISTEN_FDS_START");
int fd = Int32.Parse(fds);
// Easy mode
options.ListenHandle(fd);
// Verbose
options.ListenHandle(fd, listenOptions =>
{
listenOptions.UseHttps("server.pfx");
});
})
.UseStartup<Startup>()
.Build();
host.Run();
var host = new WebHostBuilder()
.UseKestrel(options =>
{
options.UseSystemd();
})
.UseStartup<Startup>()
.Build();
host.Run(); |
@shirhatti Is it OK to remove needs-design label then? |
This was referenced Jan 11, 2017
24 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now endpoints can only be configured via UseUrls. This limits the opportunity for validation and causes confusion about what's allowed/supported by Kestrel.
e.g. options.AddEndpoint(https, host, port); where scheme is "http" or "https", host is "localhost", "", or an IPAddress, and port is valid. This avoids confusion around why registering "http://.foo.com/" does not filter by host.
@DamianEdwards @davidfowl
The text was updated successfully, but these errors were encountered: