File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Jellyfin.HardwareVisualizer/Server Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ public class EFCoreOptions
16
16
public class HostingOptions
17
17
{
18
18
public List < string > KnownProxies { get ; set ; } = new ( ) ;
19
+ public List < string > KnownProxyNetworks { get ; set ; } = new ( ) ;
19
20
}
Original file line number Diff line number Diff line change 21
21
using ProductHeaderValue = Octokit . ProductHeaderValue ;
22
22
using System . Net ;
23
23
using Microsoft . AspNetCore . HttpOverrides ;
24
+ using IPNetwork = Microsoft . AspNetCore . HttpOverrides . IPNetwork ;
24
25
25
26
namespace Jellyfin . HardwareVisualizer . Server ;
26
27
@@ -84,6 +85,13 @@ string GetConnectionString()
84
85
{
85
86
Console . WriteLine ( $ "Add Proxy: { proxy } ") ;
86
87
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 ] ) ) ) ;
87
95
}
88
96
} ) ;
89
97
You can’t perform that action at this time.
0 commit comments