diff options
| author | David <daullmer@gmail.com> | 2020-07-11 12:35:18 +0200 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-07-11 12:43:30 +0200 |
| commit | 7367e667f78057d0e26b8dc4f2b7f8641366b86a (patch) | |
| tree | 4eb30e15f848492521d9e64b9de8bcacbd3081bb /Jellyfin.Server/Program.cs | |
| parent | 172203b5ccfe8e0647af78deb347dc42e6132c93 (diff) | |
Add socket support
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index ef3ebe90c..025de916f 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -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}"); + } }) .ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig)) .UseSerilog() |
