Compare commits

..

No commits in common. "c49ba735a01ee2ee28be9311e55f1bf4e03ecddc" and "cf3846fbfd67507b438b88ff3e24cc958c761f22" have entirely different histories.

4 changed files with 176 additions and 171 deletions

View file

@ -350,9 +350,21 @@ namespace ServiceLib.Models
public string? path { get; set; } public string? path { get; set; }
public string? host { get; set; } public string? host { get; set; }
public string? mode { 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 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 class HttpSettings4Ray
{ {
public string? path { get; set; } public string? path { get; set; }

View file

@ -1,156 +1,149 @@
[ [
{ {
"remarks": "绕过bittorrent", "remarks": "绕过bittorrent",
"outboundTag": "direct", "outboundTag": "direct",
"protocol": [ "protocol": [
"bittorrent" "bittorrent"
] ]
}, },
{ {
"remarks": "api.ip.sb", "remarks": "Google cn",
"outboundTag": "proxy", "outboundTag": "proxy",
"domain": [ "domain": [
"api.ip.sb" "domain:googleapis.cn",
] "domain:gstatic.com"
}, ]
{ },
"remarks": "Google cn", {
"outboundTag": "proxy", "remarks": "阻断udp443",
"domain": [ "outboundTag": "block",
"domain:googleapis.cn", "port": "443",
"domain:gstatic.com" "network": "udp"
] },
}, {
{ "remarks": "阻断广告",
"remarks": "阻断udp443", "outboundTag": "block",
"outboundTag": "block", "domain": [
"port": "443", "geosite:category-ads-all"
"network": "udp" ]
}, },
{ {
"remarks": "阻断广告", "remarks": "绕过局域网IP",
"outboundTag": "block", "outboundTag": "direct",
"domain": [ "ip": [
"geosite:category-ads-all" "geoip:private"
] ]
}, },
{ {
"remarks": "绕过局域网IP", "remarks": "绕过局域网域名",
"outboundTag": "direct", "outboundTag": "direct",
"ip": [ "domain": [
"geoip:private" "geosite:private"
] ]
}, },
{ {
"remarks": "绕过局域网域名", "remarks": "代理海外公共DNSIP",
"outboundTag": "direct", "outboundTag": "proxy",
"domain": [ "ip": [
"geosite:private" "1.1.1.1",
] "1.0.0.1",
}, "2606:4700:4700::1111",
{ "2606:4700:4700::1001",
"remarks": "代理海外公共DNSIP", "1.1.1.2",
"outboundTag": "proxy", "1.0.0.2",
"ip": [ "2606:4700:4700::1112",
"1.1.1.1", "2606:4700:4700::1002",
"1.0.0.1", "1.1.1.3",
"2606:4700:4700::1111", "1.0.0.3",
"2606:4700:4700::1001", "2606:4700:4700::1113",
"1.1.1.2", "2606:4700:4700::1003",
"1.0.0.2", "8.8.8.8",
"2606:4700:4700::1112", "8.8.4.4",
"2606:4700:4700::1002", "2001:4860:4860::8888",
"1.1.1.3", "2001:4860:4860::8844",
"1.0.0.3", "94.140.14.14",
"2606:4700:4700::1113", "94.140.15.15",
"2606:4700:4700::1003", "2a10:50c0::ad1:ff",
"8.8.8.8", "2a10:50c0::ad2:ff",
"8.8.4.4", "94.140.14.15",
"2001:4860:4860::8888", "94.140.15.16",
"2001:4860:4860::8844", "2a10:50c0::bad1:ff",
"94.140.14.14", "2a10:50c0::bad2:ff",
"94.140.15.15", "94.140.14.140",
"2a10:50c0::ad1:ff", "94.140.14.141",
"2a10:50c0::ad2:ff", "2a10:50c0::1:ff",
"94.140.14.15", "2a10:50c0::2:ff",
"94.140.15.16", "208.67.222.222",
"2a10:50c0::bad1:ff", "208.67.220.220",
"2a10:50c0::bad2:ff", "2620:119:35::35",
"94.140.14.140", "2620:119:53::53",
"94.140.14.141", "208.67.222.123",
"2a10:50c0::1:ff", "208.67.220.123",
"2a10:50c0::2:ff", "2620:119:35::123",
"208.67.222.222", "2620:119:53::123",
"208.67.220.220", "9.9.9.9",
"2620:119:35::35", "149.112.112.112",
"2620:119:53::53", "2620:fe::9",
"208.67.222.123", "2620:fe::fe",
"208.67.220.123", "9.9.9.11",
"2620:119:35::123", "149.112.112.11",
"2620:119:53::123", "2620:fe::11",
"9.9.9.9", "2620:fe::fe:11",
"149.112.112.112", "9.9.9.10",
"2620:fe::9", "149.112.112.10",
"2620:fe::fe", "2620:fe::10",
"9.9.9.11", "2620:fe::fe:10",
"149.112.112.11", "77.88.8.8",
"2620:fe::11", "77.88.8.1",
"2620:fe::fe:11", "2a02:6b8::feed:0ff",
"9.9.9.10", "2a02:6b8:0:1::feed:0ff",
"149.112.112.10", "77.88.8.88",
"2620:fe::10", "77.88.8.2",
"2620:fe::fe:10", "2a02:6b8::feed:bad",
"77.88.8.8", "2a02:6b8:0:1::feed:bad",
"77.88.8.1", "77.88.8.7",
"2a02:6b8::feed:0ff", "77.88.8.3",
"2a02:6b8:0:1::feed:0ff", "2a02:6b8::feed:a11",
"77.88.8.88", "2a02:6b8:0:1::feed:a11"
"77.88.8.2", ]
"2a02:6b8::feed:bad", },
"2a02:6b8:0:1::feed:bad", {
"77.88.8.7", "remarks": "代理海外公共DNS域名",
"77.88.8.3", "outboundTag": "proxy",
"2a02:6b8::feed:a11", "domain": [
"2a02:6b8:0:1::feed:a11" "domain:cloudflare-dns.com",
] "domain:one.one.one.one",
}, "domain:dns.google",
{ "domain:adguard-dns.com",
"remarks": "代理海外公共DNS域名", "domain:opendns.com",
"outboundTag": "proxy", "domain:umbrella.com",
"domain": [ "domain:quad9.net",
"domain:cloudflare-dns.com", "domain:yandex.net"
"domain:one.one.one.one", ]
"domain:dns.google", },
"domain:adguard-dns.com", {
"domain:opendns.com", "remarks": "代理IP",
"domain:umbrella.com", "outboundTag": "proxy",
"domain:quad9.net", "ip": [
"domain:yandex.net" "geoip:facebook",
] "geoip:fastly",
}, "geoip:google",
{ "geoip:netflix",
"remarks": "代理IP", "geoip:telegram",
"outboundTag": "proxy", "geoip:twitter"
"ip": [ ]
"geoip:facebook", },
"geoip:fastly", {
"geoip:google", "remarks": "代理GFW",
"geoip:netflix", "outboundTag": "proxy",
"geoip:telegram", "domain": [
"geoip:twitter" "geosite:gfw",
] "geosite:greatfire"
}, ]
{ },
"remarks": "代理GFW", {
"outboundTag": "proxy", "remarks": "最终直连",
"domain": [ "port": "0-65535",
"geosite:gfw", "outboundTag": "direct"
"geosite:greatfire" }
]
},
{
"remarks": "最终直连",
"port": "0-65535",
"outboundTag": "direct"
}
] ]

View file

@ -700,7 +700,8 @@ namespace ServiceLib.Services.CoreConfig
await GenOutboundMux(node, outbound, _config.CoreBasicItem.MuxEnabled); 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)) if (Utils.IsNotEmpty(node.Flow))
{ {
@ -744,7 +745,7 @@ namespace ServiceLib.Services.CoreConfig
} }
outbound.protocol = Global.ProtocolTypes[node.ConfigType]; outbound.protocol = Global.ProtocolTypes[node.ConfigType];
await GenBoundStreamSettings(node, outbound); await GenBoundStreamSettings(node, outbound.streamSettings);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -777,11 +778,10 @@ namespace ServiceLib.Services.CoreConfig
return 0; return 0;
} }
private async Task<int> GenBoundStreamSettings(ProfileItem node, Outbounds4Ray outbound) private async Task<int> GenBoundStreamSettings(ProfileItem node, StreamSettings4Ray streamSettings)
{ {
try try
{ {
var streamSettings = outbound.streamSettings;
streamSettings.network = node.GetNetwork(); streamSettings.network = node.GetNetwork();
var host = node.RequestHost.TrimEx(); var host = node.RequestHost.TrimEx();
var path = node.Path.TrimEx(); var path = node.Path.TrimEx();
@ -869,7 +869,7 @@ namespace ServiceLib.Services.CoreConfig
case nameof(ETransport.ws): case nameof(ETransport.ws):
WsSettings4Ray wsSettings = new(); WsSettings4Ray wsSettings = new();
wsSettings.headers = new Headers4Ray(); wsSettings.headers = new Headers4Ray();
if (Utils.IsNotEmpty(host)) if (Utils.IsNotEmpty(host))
{ {
wsSettings.host = host; wsSettings.host = host;
@ -904,7 +904,12 @@ namespace ServiceLib.Services.CoreConfig
//xhttp //xhttp
case nameof(ETransport.xhttp): case nameof(ETransport.xhttp):
streamSettings.network = ETransport.xhttp.ToString(); streamSettings.network = ETransport.xhttp.ToString();
XhttpSettings4Ray xhttpSettings = new(); XhttpSettings4Ray xhttpSettings = new()
{
scMaxEachPostBytes = "500000-1000000",
scMaxConcurrentPosts = "50-100",
scMinPostsIntervalMs = "30-50"
};
if (Utils.IsNotEmpty(path)) if (Utils.IsNotEmpty(path))
{ {
@ -924,7 +929,6 @@ namespace ServiceLib.Services.CoreConfig
} }
streamSettings.xhttpSettings = xhttpSettings; streamSettings.xhttpSettings = xhttpSettings;
await GenOutboundMux(node, outbound, false);
break; break;
//h2 //h2

View file

@ -9,6 +9,7 @@ namespace ServiceLib.ViewModels
{ {
private ConcurrentQueue<string> _queueMsg = new(); private ConcurrentQueue<string> _queueMsg = new();
private int _numMaxMsg = 500; private int _numMaxMsg = 500;
private string _lastMsgFilter = string.Empty;
private bool _lastMsgFilterNotAvailable; private bool _lastMsgFilterNotAvailable;
private bool _blLockShow = false; private bool _blLockShow = false;
@ -27,7 +28,7 @@ namespace ServiceLib.ViewModels
this.WhenAnyValue( this.WhenAnyValue(
x => x.MsgFilter) x => x.MsgFilter)
.Subscribe(c => DoMsgFilter()); .Subscribe(c => _config.MsgUIItem.MainMsgFilter = MsgFilter);
this.WhenAnyValue( this.WhenAnyValue(
x => x.AutoRefresh, x => x.AutoRefresh,
@ -76,7 +77,8 @@ namespace ServiceLib.ViewModels
private async Task EnqueueQueueMsg(string msg) private async Task EnqueueQueueMsg(string msg)
{ {
//filter msg //filter msg
if (MsgFilter.IsNotEmpty() && !_lastMsgFilterNotAvailable) if (MsgFilter != _lastMsgFilter) _lastMsgFilterNotAvailable = false;
if (Utils.IsNotEmpty(MsgFilter) && !_lastMsgFilterNotAvailable)
{ {
try try
{ {
@ -85,12 +87,12 @@ namespace ServiceLib.ViewModels
return; return;
} }
} }
catch (Exception ex) catch (Exception)
{ {
_queueMsg.Enqueue(ex.Message);
_lastMsgFilterNotAvailable = true; _lastMsgFilterNotAvailable = true;
} }
} }
_lastMsgFilter = MsgFilter;
//Enqueue //Enqueue
if (_queueMsg.Count > _numMaxMsg) if (_queueMsg.Count > _numMaxMsg)
@ -111,11 +113,5 @@ namespace ServiceLib.ViewModels
{ {
_queueMsg.Clear(); _queueMsg.Clear();
} }
private void DoMsgFilter()
{
_config.MsgUIItem.MainMsgFilter = MsgFilter;
_lastMsgFilterNotAvailable = false;
}
} }
} }