Release 1.8.0: auto-update with restart and AmneziaWG 2.0 support.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -34,6 +34,21 @@ func proxyHost(proxy string) string {
|
||||
if proxy == "" {
|
||||
return ""
|
||||
}
|
||||
lower := strings.ToLower(proxy)
|
||||
if strings.Contains(lower, "[interface]") {
|
||||
for _, line := range strings.Split(proxy, "\n") {
|
||||
line = strings.TrimSpace(line)
|
||||
if len(line) >= 9 && strings.EqualFold(line[:8], "endpoint") {
|
||||
_, val, ok := strings.Cut(line, "=")
|
||||
if !ok {
|
||||
_, val, ok = strings.Cut(line, ":")
|
||||
}
|
||||
if ok {
|
||||
return strings.TrimSpace(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if i := strings.Index(proxy, "://"); i >= 0 {
|
||||
proxy = proxy[i+3:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user