Release 1.3.0: Hysteria2 BBR/Salamander/masquerade options and subscription URL import.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Navis
2026-07-28 07:26:17 +03:00
co-authored by Cursor
parent 7eaf53f7c2
commit 5d2cb6d76a
18 changed files with 807 additions and 52 deletions
+35
View File
@@ -0,0 +1,35 @@
package hysteria2
import "vpnclient/internal/config"
// EnrichProfile fills empty hy2 option fields from the share URI.
func EnrichProfile(p *config.Profile) {
if p == nil || p.Protocol != config.ProtocolHysteria2 || p.Proxy == "" {
return
}
ep, err := ParseEndpoint(p.Proxy)
if err != nil {
return
}
if p.Hy2SNI == "" {
p.Hy2SNI = ep.SNI
}
if p.Hy2Obfs == "" {
p.Hy2Obfs = ep.Obfs
}
if p.Hy2ObfsPassword == "" {
p.Hy2ObfsPassword = ep.ObfsPassword
}
if p.Hy2PinSHA256 == "" {
p.Hy2PinSHA256 = ep.PinSHA256
}
if ep.Insecure {
p.Hy2Insecure = true
}
if p.Hy2Congestion == "" {
p.Hy2Congestion = "bbr"
}
if p.Hy2BBRProfile == "" {
p.Hy2BBRProfile = "standard"
}
}