Hysteria Realm & Gecko (#9516)

* Hysteria Realm

* Core config

* Fix

* Fix

* Add Gecko support
This commit is contained in:
DHR60
2026-06-22 20:52:47 +08:00
committed by GitHub
parent 81c118c9b2
commit ef46f4e7e6
19 changed files with 763 additions and 191 deletions
@@ -80,6 +80,15 @@ public class AddServerViewModel : MyReactiveObject
[Reactive]
public bool NaiveQuic { get; set; }
[Reactive]
public string Hy2RealmUrl { get; set; }
[Reactive]
public int GeckoMinPacketSize { get; set; }
[Reactive]
public int GeckoMaxPacketSize { get; set; }
[Reactive]
public string RawHeaderType { get; set; }
@@ -302,6 +311,9 @@ public class AddServerViewModel : MyReactiveObject
CongestionControl = protocolExtra.CongestionControl ?? string.Empty;
InsecureConcurrency = protocolExtra.InsecureConcurrency > 0 ? protocolExtra.InsecureConcurrency : null;
NaiveQuic = protocolExtra.NaiveQuic ?? false;
Hy2RealmUrl = protocolExtra.Hy2RealmUrl ?? string.Empty;
GeckoMinPacketSize = protocolExtra.GeckoMinPacketSize.ToInt();
GeckoMaxPacketSize = protocolExtra.GeckoMaxPacketSize.ToInt();
RawHeaderType = transport.RawHeaderType ?? Global.None;
Host = transport.Host ?? string.Empty;
@@ -357,6 +369,16 @@ public class AddServerViewModel : MyReactiveObject
return;
}
}
HyRealm? realm = null;
if (!Hy2RealmUrl.IsNullOrEmpty())
{
var realmResult = HyRealm.TryParse(Hy2RealmUrl, out realm);
if (!realmResult)
{
NoticeManager.Instance.Enqueue(ResUI.InvalidHy2RealmUrl);
return;
}
}
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : Enum.Parse<ECoreType>(CoreType);
SelectedSource.AllowInsecure = AllowInsecure ? Global.StringTrue : Global.StringFalse;
SelectedSource.MuxEnabled = MuxEnabled;
@@ -403,6 +425,9 @@ public class AddServerViewModel : MyReactiveObject
CongestionControl = CongestionControl.NullIfEmpty(),
InsecureConcurrency = InsecureConcurrency > 0 ? InsecureConcurrency : null,
NaiveQuic = NaiveQuic ? true : null,
Hy2RealmUrl = realm?.ToUri().NullIfEmpty(),
GeckoMinPacketSize = GeckoMinPacketSize > 0 ? GeckoMinPacketSize.ToString() : null,
GeckoMaxPacketSize = GeckoMaxPacketSize > 0 ? GeckoMaxPacketSize.ToString() : null,
});
SelectedSource.SetTransportExtra(transport);