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
-25
View File
@@ -180,32 +180,7 @@ func (e *Engine) LocalSOCKSProxy() (string, bool) {
return e.profile.SOCKSListenHostPort()
}
func writeRuntimeConfig(path string, profile config.Profile) error {
server, _, err := NormalizeShareLink(profile.Proxy)
if err != nil {
return err
}
socks := "127.0.0.1:1080"
httpListen := "127.0.0.1:1081"
if hp, ok := profile.SOCKSListenHostPort(); ok {
socks = hp
}
if hp, ok := profile.HTTPListenHostPort(); ok {
httpListen = hp
}
var b strings.Builder
b.WriteString("# generated by Navis — do not edit\n")
b.WriteString("server: " + yamlQuote(server) + "\n")
b.WriteString("socks5:\n")
b.WriteString(" listen: " + yamlQuote(socks) + "\n")
b.WriteString("http:\n")
b.WriteString(" listen: " + yamlQuote(httpListen) + "\n")
return os.WriteFile(path, []byte(b.String()), 0o600)
}
func yamlQuote(s string) string {
// Always quote — URIs and host:port can confuse YAML.
escaped := strings.ReplaceAll(s, `\`, `\\`)
escaped = strings.ReplaceAll(escaped, `"`, `\"`)
return `"` + escaped + `"`