From 4467f1f022d07dc574c1bea2d3461cd17b99dcf4 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 28 Jan 2021 00:15:16 +0100 Subject: [PATCH] Add persistent sessions using redis --- README.md | 1 + RTMPDash.csproj | 1 + Startup.cs | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 5f7391a..45ac38d 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ - Create yourself a user using `sqlite3` - Install [nginx-mod-rtmp](https://git.zotan.services/zotan/nginx-mod-rtmp) (arch package: `aur/nginx-mod-rtmp-lhaus-git`) - Configure nginx-mod-rtmp, example config below +- Install and start `redis` for persistent sessions - Start RTMPDash, example systemd unit below ## Further setup diff --git a/RTMPDash.csproj b/RTMPDash.csproj index e2ef4b0..190f007 100644 --- a/RTMPDash.csproj +++ b/RTMPDash.csproj @@ -8,6 +8,7 @@ + diff --git a/Startup.cs b/Startup.cs index 28ab900..f84ab07 100644 --- a/Startup.cs +++ b/Startup.cs @@ -22,8 +22,17 @@ namespace RTMPDash { #if (DEBUG) services.AddControllers().AddRazorRuntimeCompilation(); + services.AddStackExchangeRedisCache(options => { + options.Configuration = "localhost"; + options.InstanceName = "RTMPdash_development"; + }); #else services.AddControllers(); + services.AddStackExchangeRedisCache(options => + { + options.Configuration = "localhost"; + options.InstanceName = "RTMPdash_production"; + }); #endif }