fix(hysteria2): emit https server_url for sing-box realm outbound (#9642)

sing-box requires realm.server_url as a full URL (https://host:port).
Bare host:port caused "missing host in realm server_url" on import.
Also forward stun_servers and clear ResolveRealm success message.

Fixes #9635
This commit is contained in:
dr mike
2026-06-28 06:35:41 +03:30
committed by GitHub
parent 5a9a9b7ab1
commit bf376a8fac
6 changed files with 78 additions and 1 deletions
+9
View File
@@ -15,6 +15,15 @@ public record HyRealm(
{
public string RendezvousHostPort => RendezvousPort > 0 ? $"{RendezvousHost}:{RendezvousPort}" : RendezvousHost;
/// <summary>
/// sing-box realm.server_url requires a scheme (https:// or http://).
/// </summary>
public string ToServerUrl()
{
var scheme = IsHttp ? "http" : "https";
return $"{scheme}://{RendezvousHostPort}";
}
public static bool TryParse(string? str, out HyRealm? realm)
{
realm = null;