diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-05 10:07:17 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-05 10:07:17 -0400 |
| commit | f91f2ef328a9d7693956ab33bf5c70be2f1213df (patch) | |
| tree | b1e0bba89071f6930e0c9b08c8e6ff086f8120d3 /Jellyfin.Server/Program.cs | |
| parent | f2760cb055ae6ee5971ca4a3ff342ecd7d829d99 (diff) | |
| parent | 29539174a3de47c151cc7c7fd192100e6fbe48d7 (diff) | |
Merge remote-tracking branch 'upstream/master' into register-services-correctly
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 56017cf89..193d30e3a 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -25,6 +25,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Serilog; @@ -257,7 +258,7 @@ namespace Jellyfin.Server IApplicationPaths appPaths) { return new WebHostBuilder() - .UseKestrel(options => + .UseKestrel((builderContext, options) => { var addresses = appHost.ServerConfigurationManager .Configuration @@ -280,6 +281,14 @@ namespace Jellyfin.Server listenOptions.Protocols = HttpProtocols.Http1AndHttp2; }); } + else if (builderContext.HostingEnvironment.IsDevelopment()) + { + options.Listen(address, appHost.HttpsPort, listenOptions => + { + listenOptions.UseHttps(); + listenOptions.Protocols = HttpProtocols.Http1AndHttp2; + }); + } } } else @@ -295,6 +304,14 @@ namespace Jellyfin.Server listenOptions.Protocols = HttpProtocols.Http1AndHttp2; }); } + else if (builderContext.HostingEnvironment.IsDevelopment()) + { + options.ListenAnyIP(appHost.HttpsPort, listenOptions => + { + listenOptions.UseHttps(); + listenOptions.Protocols = HttpProtocols.Http1AndHttp2; + }); + } } }) .ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig)) |
