Merge pull request #3532 from Ullmie02/socket-binding

Add support for binding to Unix socket
This commit is contained in:
Bond-009 2020-07-23 12:30:25 +02:00 committed by GitHub
commit 9ffe74d979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,6 +343,21 @@ namespace Jellyfin.Server
} }
} }
} }
// Bind to unix socket (only on OSX and Linux)
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// TODO: allow configuration of socket path
var socketPath = $"{appPaths.DataPath}/socket.sock";
// Workaround for https://github.com/aspnet/AspNetCore/issues/14134
if (File.Exists(socketPath))
{
File.Delete(socketPath);
}
options.ListenUnixSocket(socketPath);
_logger.LogInformation("Kestrel listening to unix socket {SocketPath}", socketPath);
}
}) })
.ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig)) .ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig))
.UseSerilog() .UseSerilog()