Skip to content

Commit 568c8a8

Browse files
author
JPVenson
committed
Added ProxyNetwork setting
1 parent 3d68360 commit 568c8a8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Jellyfin.HardwareVisualizer/Server/Configuration/EFCoreOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ public class EFCoreOptions
1616
public class HostingOptions
1717
{
1818
public List<string> KnownProxies { get; set; } = new();
19+
public List<string> KnownProxyNetworks { get; set; } = new();
1920
}

Jellyfin.HardwareVisualizer/Server/Program.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using ProductHeaderValue = Octokit.ProductHeaderValue;
2222
using System.Net;
2323
using Microsoft.AspNetCore.HttpOverrides;
24+
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
2425

2526
namespace Jellyfin.HardwareVisualizer.Server;
2627

@@ -84,6 +85,13 @@ string GetConnectionString()
8485
{
8586
Console.WriteLine($"Add Proxy: {proxy}");
8687
options.KnownProxies.Add(IPAddress.Parse(proxy));
88+
}
89+
90+
foreach(var proxy in hostingOptions.KnownProxyNetworks ?? [])
91+
{
92+
Console.WriteLine($"Add Proxy: {proxy}");
93+
var proxyNetwork = proxy.Split("/");
94+
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse(proxyNetwork[0]), int.Parse(proxyNetwork[1])));
8795
}
8896
});
8997

0 commit comments

Comments
 (0)