Improve VPN video routing, profile storage and authorization reuse

This commit is contained in:
shen
2026-10-13 00:34:16 -07:00
parent c94143dfae
commit f94dab0555
30 changed files with 1303 additions and 139 deletions
+18
View File
@@ -0,0 +1,18 @@
package bridge
// The measured macOS VLESS/Reality Vision path benefits from video TCP fallback.
// Share the narrowly scoped policy with Android's platform-owned TUN. Native
// UDP proxies, custom routing policies and unrelated QUIC remain unchanged.
func (c Config) preferVideoTCPOn(platform string) bool {
tun := (platform == "darwin" && c.DesktopTun) || (platform == "android" && c.Tun != nil)
if !tun || c.Proxy == nil ||
c.Proxy["type"] != "vless" || c.Proxy["flow"] != "xtls-rprx-vision" || c.Proxy["transport"] != nil {
return false
}
tls, ok := c.Proxy["tls"].(map[string]any)
if !ok || tls["enabled"] != true {
return false
}
reality, ok := tls["reality"].(map[string]any)
return ok && reality["enabled"] == true
}