aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-07-23 12:30:25 +0200
committerGitHub <noreply@github.com>2020-07-23 12:30:25 +0200
commit9ffe74d97914c82c88f1664a991d2cb65f14a827 (patch)
tree0a32ac59f52f195536fa66bfe61f8b30b9b3ee4d
parent7686f53f527f9d3511e5f9b96e3c9d982e9bf8e9 (diff)
parent0e855953a2078c2229cffedf015baa107be1cbf4 (diff)
Merge pull request #3532 from Ullmie02/socket-binding
Add support for binding to Unix socket
-rw-r--r--Jellyfin.Server/Program.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index ef3ebe90c..444a91c02 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}", socketPath);
+ }
})
.ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig))
.UseSerilog()