mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-10-10 04:03:11 +08:00
feat: support AmneziaWG v3.1
This commit is contained in:
@@ -136,6 +136,8 @@ type AmneziaWGOption struct {
|
||||
RejectAfterTime string `proxy:"reject-after-time,omitempty"`
|
||||
KeepaliveTimeout string `proxy:"keepalive-timeout,omitempty"`
|
||||
MaxHandshakeAttempts string `proxy:"max-handshake-attempts,omitempty"`
|
||||
RandomTrailers bool `proxy:"random-trailers,omitempty"` // AmneziaWG v3.1+
|
||||
DisableCookies bool `proxy:"disable-cookies,omitempty"` // AmneziaWG v3.1+
|
||||
}
|
||||
|
||||
type IPStackOption struct {
|
||||
@@ -678,6 +680,12 @@ func (w *WireGuard) genIpcConf(ctx context.Context, updateOnly bool) (string, er
|
||||
if w.option.AmneziaWGOption.MaxHandshakeAttempts != "" {
|
||||
ipcConf += "max_handshake_attempts=" + w.option.AmneziaWGOption.MaxHandshakeAttempts + "\n"
|
||||
}
|
||||
if w.option.AmneziaWGOption.RandomTrailers {
|
||||
ipcConf += "random_trailers=1\n"
|
||||
}
|
||||
if w.option.AmneziaWGOption.DisableCookies {
|
||||
ipcConf += "disable_cookies=1\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(w.option.Peers) > 0 {
|
||||
|
||||
@@ -1339,6 +1339,8 @@ proxies: # socks5
|
||||
# reject-after-time: 180 # AmneziaWG v3+
|
||||
# keepalive-timeout: 10 # AmneziaWG v3+
|
||||
# max-handshake-attempts: 18 # AmneziaWG v3+
|
||||
# random-trailers: true # AmneziaWG v3.1+
|
||||
# disable-cookies: true # AmneziaWG v3.1+
|
||||
|
||||
# tailscale
|
||||
- name: "tailscale"
|
||||
|
||||
@@ -11,7 +11,7 @@ require (
|
||||
github.com/gofrs/uuid/v5 v5.4.0
|
||||
github.com/golang/snappy v1.0.0
|
||||
github.com/metacubex/age v0.0.0-20260603010618-28d156b4ea78
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20260726091836-16af3a7a9a29
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20260816073447-736a78668832
|
||||
github.com/metacubex/bart v0.29.0
|
||||
github.com/metacubex/bbolt v0.0.0-20260706163408-d4ec34ad7c48
|
||||
github.com/metacubex/blake3 v0.1.0
|
||||
|
||||
@@ -92,8 +92,8 @@ github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos
|
||||
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
|
||||
github.com/metacubex/age v0.0.0-20260603010618-28d156b4ea78 h1:LqWr0vb9zDNuQS+jJd4fnRYk/SEI7KJ7TDe/L4WFK48=
|
||||
github.com/metacubex/age v0.0.0-20260603010618-28d156b4ea78/go.mod h1:BTBG/iVY7rg3qq5WdVCg0GFk58CSvCDSbjy8I7kEx/c=
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20260726091836-16af3a7a9a29 h1:ArOD/vshXuXIvyYOrysVojADKQtGIq6UOABrXmaNcKU=
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20260726091836-16af3a7a9a29/go.mod h1:MsM/5czONyXMJ3PRr5DbQ4O/BxzAnJWOIcJdLzW6qHY=
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20260816073447-736a78668832 h1:mAIVFc8Z9jziImzNl5bXUBVU2bTEmP2sXfosn/6YxPs=
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20260816073447-736a78668832/go.mod h1:MsM/5czONyXMJ3PRr5DbQ4O/BxzAnJWOIcJdLzW6qHY=
|
||||
github.com/metacubex/ascon v0.1.0 h1:6ZWxmXYszT1XXtwkf6nxfFhc/OTtQ9R3Vyj1jN32lGM=
|
||||
github.com/metacubex/ascon v0.1.0/go.mod h1:eV5oim4cVPPdEL8/EYaTZ0iIKARH9pnhAK/fcT5Kacc=
|
||||
github.com/metacubex/bart v0.29.0 h1:yVc/lLdDqn+7FShI0qUghStHl0/d3mn4EH/I5R5niKk=
|
||||
|
||||
Reference in New Issue
Block a user