Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
chatop2020 committed Nov 21, 2023
1 parent 2d3e4f3 commit 7a86182
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Binary file modified AKStreamKeeper/AKStream.ldb
Binary file not shown.
15 changes: 9 additions & 6 deletions AKStreamKeeper/MediaServerInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ public bool SetConfig(out ResponseStruct rs)
Uri AKStreamWebUri = new Uri(Common.AkStreamKeeperConfig.AkStreamWebRegisterUrl);
string h = AKStreamWebUri.Host.Trim();
string p = AKStreamWebUri.Port.ToString();
string h2 = _akStreamKeeperConfig.IpV4Address;
string h3 = _akStreamKeeperConfig.Candidate;
// string h2 = _akStreamKeeperConfig.IpV4Address;
// string h3 = _akStreamKeeperConfig.Candidate;

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && File.Exists("/etc/hostname"))
{
Expand Down Expand Up @@ -933,7 +933,7 @@ public bool SetConfig(out ResponseStruct rs)
_zlmNewConfig.Rtsp.AuthBasic = 1;
}

if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
/*if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h) && UtilsHelper.IsIpAddr(h))
{
if (_zlmNewConfig.Http.Allow_Ip_Range.EndsWith(","))
Expand All @@ -945,7 +945,7 @@ public bool SetConfig(out ResponseStruct rs)
_zlmNewConfig.Http.Allow_Ip_Range += "," + h;
}
}
if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h2) && UtilsHelper.IsIpAddr(h2))
{
Expand All @@ -958,7 +958,7 @@ public bool SetConfig(out ResponseStruct rs)
_zlmNewConfig.Http.Allow_Ip_Range += "," + h2;
}
}
if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h3) && UtilsHelper.IsIpAddr(h3))
{
Expand All @@ -970,9 +970,12 @@ public bool SetConfig(out ResponseStruct rs)
{
_zlmNewConfig.Http.Allow_Ip_Range += "," + h3;
}
}*/
if (_zlmNewConfig != null && _zlmNewConfig.Http != null)
{
_zlmNewConfig.Http.Allow_Ip_Range = ""; //把ip白名单去掉
}


_zlmNewConfig.Hook.On_Shell_Login =
$"http://{h}:{p}/MediaServer/WebHook/OnShellLogin"; //shell鉴权
_zlmNewConfig.Hook.On_Stream_Changed =
Expand Down
5 changes: 1 addition & 4 deletions LibCommon/Structs/ZLMediaKitConfig/ZLMediaKitConfigNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,7 @@ public bool SetConfig(string configPath)
data["http"]["allow_cross_domains"] = Http.Allow_Cross_Domains.Trim();
}

if (!string.IsNullOrEmpty(Http.Allow_Ip_Range))
{
data["http"]["allow_ip_range"] = Http.Allow_Ip_Range.Trim();
}
data["http"]["allow_ip_range"] = Http.Allow_Ip_Range.Trim()+" ";
}

#endregion
Expand Down

0 comments on commit 7a86182

Please sign in to comment.