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:
@@ -23,9 +23,12 @@ type Config struct {
|
||||
// SystemProxy enables Windows Internet Settings / WinHTTP proxy on connect.
|
||||
SystemProxy bool `json:"system_proxy"`
|
||||
|
||||
// BinDir is where protocol binaries (naive.exe) are stored.
|
||||
// BinDir is where protocol binaries (naive.exe / hysteria.exe) are stored.
|
||||
BinDir string `json:"bin_dir,omitempty"`
|
||||
|
||||
// SubscriptionURL pulls share links (one per line or base64) and imports profiles.
|
||||
SubscriptionURL string `json:"subscription_url,omitempty"`
|
||||
|
||||
Profiles []Profile `json:"profiles"`
|
||||
}
|
||||
|
||||
@@ -47,6 +50,22 @@ type Profile struct {
|
||||
NoPostQuantum bool `json:"no_post_quantum,omitempty"`
|
||||
Log string `json:"log,omitempty"`
|
||||
Env map[string]string `json:"env,omitempty"`
|
||||
|
||||
// Hysteria 2 options (client-side). Masquerade on server is separate;
|
||||
// here SNI/insecure/pin emulate HTTPS look + salamander/gecko obfuscation.
|
||||
Hy2Congestion string `json:"hy2_congestion,omitempty"` // bbr | reno
|
||||
Hy2BBRProfile string `json:"hy2_bbr_profile,omitempty"` // standard | conservative | aggressive
|
||||
Hy2BandwidthUp string `json:"hy2_bandwidth_up,omitempty"` // empty = BBR; set for Brutal
|
||||
Hy2BandwidthDown string `json:"hy2_bandwidth_down,omitempty"`
|
||||
Hy2Obfs string `json:"hy2_obfs,omitempty"` // salamander | gecko
|
||||
Hy2ObfsPassword string `json:"hy2_obfs_password,omitempty"`
|
||||
Hy2SNI string `json:"hy2_sni,omitempty"`
|
||||
Hy2Insecure bool `json:"hy2_insecure,omitempty"`
|
||||
Hy2PinSHA256 string `json:"hy2_pin_sha256,omitempty"`
|
||||
Hy2FastOpen bool `json:"hy2_fast_open,omitempty"`
|
||||
Hy2Lazy bool `json:"hy2_lazy,omitempty"`
|
||||
Hy2HopInterval string `json:"hy2_hop_interval,omitempty"` // e.g. 30s
|
||||
Hy2ALPN string `json:"hy2_alpn,omitempty"`
|
||||
}
|
||||
|
||||
// DefaultListen returns listen addresses suitable for Windows system proxy.
|
||||
|
||||
@@ -80,11 +80,7 @@ func (c *Config) UpsertProfileWithProtocol(name, proxy string, proto Protocol) e
|
||||
for i := range c.Profiles {
|
||||
if c.Profiles[i].Name == name {
|
||||
c.Profiles[i].Proxy = proxy
|
||||
if proto != "" {
|
||||
c.Profiles[i].Protocol = proto
|
||||
} else if c.Profiles[i].Protocol == "" {
|
||||
c.Profiles[i].Protocol = ProtocolNaive
|
||||
}
|
||||
c.Profiles[i].Protocol = proto
|
||||
if len(c.Profiles[i].Listen) == 0 {
|
||||
c.Profiles[i].Listen = defaultListen()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user