mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-14 04:19:12 +00:00
Compare commits
3 commits
cf3846fbfd
...
c49ba735a0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c49ba735a0 | ||
![]() |
1a33c598e8 | ||
![]() |
a4bbdb49de |
4 changed files with 171 additions and 176 deletions
|
@ -350,21 +350,9 @@ namespace ServiceLib.Models
|
|||
public string? path { get; set; }
|
||||
public string? host { get; set; }
|
||||
public string? mode { get; set; }
|
||||
public object? scMaxEachPostBytes { get; set; }
|
||||
public object? scMaxConcurrentPosts { get; set; }
|
||||
public object? scMinPostsIntervalMs { get; set; }
|
||||
//public Xmux4Ray? xmux { get; set; }
|
||||
public object? extra { get; set; }
|
||||
}
|
||||
|
||||
//public class Xmux4Ray
|
||||
//{
|
||||
// public object? maxConcurrency { get; set; }
|
||||
// public object? maxConnections { get; set; }
|
||||
// public object? cMaxReuseTimes { get; set; }
|
||||
// public object? cMaxLifetimeMs { get; set; }
|
||||
//}
|
||||
|
||||
public class HttpSettings4Ray
|
||||
{
|
||||
public string? path { get; set; }
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
"bittorrent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"remarks": "api.ip.sb",
|
||||
"outboundTag": "proxy",
|
||||
"domain": [
|
||||
"api.ip.sb"
|
||||
]
|
||||
},
|
||||
{
|
||||
"remarks": "Google cn",
|
||||
"outboundTag": "proxy",
|
||||
|
|
|
@ -700,8 +700,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||
|
||||
await GenOutboundMux(node, outbound, _config.CoreBasicItem.MuxEnabled);
|
||||
|
||||
if (node.StreamSecurity == Global.StreamSecurityReality
|
||||
|| node.StreamSecurity == Global.StreamSecurity)
|
||||
if (node.StreamSecurity == Global.StreamSecurityReality || node.StreamSecurity == Global.StreamSecurity)
|
||||
{
|
||||
if (Utils.IsNotEmpty(node.Flow))
|
||||
{
|
||||
|
@ -745,7 +744,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||
}
|
||||
|
||||
outbound.protocol = Global.ProtocolTypes[node.ConfigType];
|
||||
await GenBoundStreamSettings(node, outbound.streamSettings);
|
||||
await GenBoundStreamSettings(node, outbound);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -778,10 +777,11 @@ namespace ServiceLib.Services.CoreConfig
|
|||
return 0;
|
||||
}
|
||||
|
||||
private async Task<int> GenBoundStreamSettings(ProfileItem node, StreamSettings4Ray streamSettings)
|
||||
private async Task<int> GenBoundStreamSettings(ProfileItem node, Outbounds4Ray outbound)
|
||||
{
|
||||
try
|
||||
{
|
||||
var streamSettings = outbound.streamSettings;
|
||||
streamSettings.network = node.GetNetwork();
|
||||
var host = node.RequestHost.TrimEx();
|
||||
var path = node.Path.TrimEx();
|
||||
|
@ -904,12 +904,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||
//xhttp
|
||||
case nameof(ETransport.xhttp):
|
||||
streamSettings.network = ETransport.xhttp.ToString();
|
||||
XhttpSettings4Ray xhttpSettings = new()
|
||||
{
|
||||
scMaxEachPostBytes = "500000-1000000",
|
||||
scMaxConcurrentPosts = "50-100",
|
||||
scMinPostsIntervalMs = "30-50"
|
||||
};
|
||||
XhttpSettings4Ray xhttpSettings = new();
|
||||
|
||||
if (Utils.IsNotEmpty(path))
|
||||
{
|
||||
|
@ -929,6 +924,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||
}
|
||||
|
||||
streamSettings.xhttpSettings = xhttpSettings;
|
||||
await GenOutboundMux(node, outbound, false);
|
||||
|
||||
break;
|
||||
//h2
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace ServiceLib.ViewModels
|
|||
{
|
||||
private ConcurrentQueue<string> _queueMsg = new();
|
||||
private int _numMaxMsg = 500;
|
||||
private string _lastMsgFilter = string.Empty;
|
||||
private bool _lastMsgFilterNotAvailable;
|
||||
private bool _blLockShow = false;
|
||||
|
||||
|
@ -28,7 +27,7 @@ namespace ServiceLib.ViewModels
|
|||
|
||||
this.WhenAnyValue(
|
||||
x => x.MsgFilter)
|
||||
.Subscribe(c => _config.MsgUIItem.MainMsgFilter = MsgFilter);
|
||||
.Subscribe(c => DoMsgFilter());
|
||||
|
||||
this.WhenAnyValue(
|
||||
x => x.AutoRefresh,
|
||||
|
@ -77,8 +76,7 @@ namespace ServiceLib.ViewModels
|
|||
private async Task EnqueueQueueMsg(string msg)
|
||||
{
|
||||
//filter msg
|
||||
if (MsgFilter != _lastMsgFilter) _lastMsgFilterNotAvailable = false;
|
||||
if (Utils.IsNotEmpty(MsgFilter) && !_lastMsgFilterNotAvailable)
|
||||
if (MsgFilter.IsNotEmpty() && !_lastMsgFilterNotAvailable)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -87,12 +85,12 @@ namespace ServiceLib.ViewModels
|
|||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_queueMsg.Enqueue(ex.Message);
|
||||
_lastMsgFilterNotAvailable = true;
|
||||
}
|
||||
}
|
||||
_lastMsgFilter = MsgFilter;
|
||||
|
||||
//Enqueue
|
||||
if (_queueMsg.Count > _numMaxMsg)
|
||||
|
@ -113,5 +111,11 @@ namespace ServiceLib.ViewModels
|
|||
{
|
||||
_queueMsg.Clear();
|
||||
}
|
||||
|
||||
private void DoMsgFilter()
|
||||
{
|
||||
_config.MsgUIItem.MainMsgFilter = MsgFilter;
|
||||
_lastMsgFilterNotAvailable = false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue