Skip to content

Commit

Permalink
Add more options to xray fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 8, 2025
1 parent 98d4a47 commit d93c12b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions v2rayN/ServiceLib/Handler/ConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ public class ConfigHandler
config.SystemProxyItem ??= new();
config.WebDavItem ??= new();
config.CheckUpdateItem ??= new();
config.Fragment4RayItem ??= new()
{
Packets = "tlshello",
Length = "100-200",
Interval = "10-20"
};

if (Utils.IsNotEmpty(config.ConstItem.DefIEProxyExceptions))
{
Expand Down
1 change: 1 addition & 0 deletions v2rayN/ServiceLib/Models/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public bool IsRunningCore(ECoreType type)
public SystemProxyItem SystemProxyItem { get; set; }
public WebDavItem WebDavItem { get; set; }
public CheckUpdateItem CheckUpdateItem { get; set; }
public Fragment4RayItem? Fragment4RayItem { get; set; }
public List<InItem> Inbound { get; set; }
public List<KeyEventItem> GlobalHotkeys { get; set; }
public List<CoreTypeItem> CoreTypeItem { get; set; }
Expand Down
8 changes: 8 additions & 0 deletions v2rayN/ServiceLib/Models/ConfigItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,12 @@ public class CheckUpdateItem
public bool CheckPreReleaseUpdate { get; set; }
public List<string>? SelectedCoreTypes { get; set; }
}

[Serializable]
public class Fragment4RayItem
{
public string? Packets { get; set; }
public string? Length { get; set; }
public string? Interval { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,9 @@ private async Task<int> GenMoreOutbounds(ProfileItem node, V2rayConfig v2rayConf
{
fragment = new()
{
packets = "tlshello",
length = "100-200",
interval = "10-20"
packets = _config.Fragment4RayItem?.Packets,
length = _config.Fragment4RayItem?.Length,
interval = _config.Fragment4RayItem?.Interval
}
}
};
Expand Down

0 comments on commit d93c12b

Please sign in to comment.