mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-07 06:37:09 +02:00
Merge eb79e93724
into 6d4efe6523
This commit is contained in:
commit
70e89e6ab1
@ -77,22 +77,20 @@ public static class WebHostBuilderExtensions
|
|||||||
WebHostBuilderContext builderContext,
|
WebHostBuilderContext builderContext,
|
||||||
KestrelServerOptions options)
|
KestrelServerOptions options)
|
||||||
{
|
{
|
||||||
bool flagged = false;
|
var flagged = false;
|
||||||
foreach (var netAdd in addresses)
|
|
||||||
|
void ConfigureHttps(ListenOptions listenOptions)
|
||||||
{
|
{
|
||||||
var address = netAdd.Address;
|
if (!httpsPort.HasValue)
|
||||||
logger.LogInformation("Kestrel is listening on {Address}", address.Equals(IPAddress.IPv6Any) ? "all interfaces" : address);
|
|
||||||
options.Listen(netAdd.Address, httpPort);
|
|
||||||
if (httpsPort.HasValue)
|
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (builderContext.HostingEnvironment.IsDevelopment())
|
if (builderContext.HostingEnvironment.IsDevelopment())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
options.Listen(
|
listenOptions.UseHttps();
|
||||||
address,
|
|
||||||
httpsPort.Value,
|
|
||||||
listenOptions => listenOptions.UseHttps());
|
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
{
|
{
|
||||||
@ -110,12 +108,19 @@ public static class WebHostBuilderExtensions
|
|||||||
throw new InvalidOperationException("Cannot run jellyfin with https without setting a valid certificate.");
|
throw new InvalidOperationException("Cannot run jellyfin with https without setting a valid certificate.");
|
||||||
}
|
}
|
||||||
|
|
||||||
options.Listen(
|
listenOptions.UseHttps(certificate);
|
||||||
address,
|
|
||||||
httpsPort.Value,
|
|
||||||
listenOptions => listenOptions.UseHttps(certificate));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var netAdd in addresses)
|
||||||
|
{
|
||||||
|
var address = netAdd.Address;
|
||||||
|
logger.LogInformation("Kestrel is listening on {Address}", address.Equals(IPAddress.IPv6Any) ? "all interfaces" : address);
|
||||||
|
options.Listen(address, httpPort);
|
||||||
|
if (httpsPort.HasValue)
|
||||||
|
{
|
||||||
|
options.Listen(address, httpsPort.Value, ConfigureHttps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bind to unix socket (only on unix systems)
|
// Bind to unix socket (only on unix systems)
|
||||||
@ -129,8 +134,9 @@ public static class WebHostBuilderExtensions
|
|||||||
File.Delete(socketPath);
|
File.Delete(socketPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
options.ListenUnixSocket(socketPath);
|
options.ListenUnixSocket(socketPath, ConfigureHttps);
|
||||||
logger.LogInformation("Kestrel listening to unix socket {SocketPath}", socketPath);
|
|
||||||
|
logger.LogInformation("Kestrel listening on unix socket {SocketPath}", socketPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user