AmneziaWG 3.1 support in wireguard endpoint?

Aperta
#4,728 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

Start from the wireguard endpoint option struct and the wireguard-go fork sing-box vendors, then compare against amnezia-vpn/amneziawg-go (the MIT reference fork) and the AmneziaWG docs linked in the issue. The work is two parts: patch the fork to implement the 3.0/3.1 handshake and transport changes (header protection, padding, randomized timers, trailers, cookie skipping), then expose the listed option names (Jc, S1-S4, H1-H4, HeaderProtectionKey, RekeyAfterTime, RandomTrailers, DisableCookies, …) on the endpoint, defaulting to plain wireguard when unset. Done means an unmodified config still behaves as before and a test build connects to a real 3.1 server, which the reporter offers to test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi. I know this was asked before (#1928, #2557, #3159, #4045 and PR #2670) and the answer was no, so I'll keep it short and only about what changed since then.

In #2557 the point was that awg is not real obfuscation, it just put junk into packet headers. For 1.x that was fair. But 3.0 and 3.1 are different protocol already:

  • header fields are hidden with ChaCha20 (HeaderProtectionKey), so the header is not cleartext anymore
  • random padding on transport packets
  • rekey / keepalive / timeout / handshake retry timers are randomized
  • 3.1 adds random trailers and can skip Cookie Reply

swgp-go doesn't really help here, it needs it's own side on the server, and the point is to connect to existing awg servers.

What I'm asking for: optional fields on the wireguard endpoint, same names as in amneziawg-go:

  • old ones: Jc, Jmin, Jmax, S1-S4, H1-H4, I1-I5
  • 3.0: HeaderProtectionKey, ContentPaddingAddition, RekeyAfterTime, RekeyTimeout, RejectAfterTime, KeepaliveTimeout, MaxHandshakeAttempts
  • 3.1: RandomTrailers, DisableCookies

If nothing is set it's just normal wireguard, so existing configs don't change. A build tag is fine too if you don't want it in default builds.

Reference impl is https://github.com/amnezia-vpn/amneziawg-go (MIT, fork of wireguard-go), docs are here: https://docs.amnezia.org/documentation/amnezia-wg/. sing-box already has its own wireguard-go fork, so I guess it's mostly a patch there + options.

Why I need it: split tunneling in the official Amnezia client is broken right now. The client can hang on connect, and for some people it only goes away after turning split tunneling off (amnezia-vpn/amnezia-client#3081). On linux the site list is just not applied, reported back in april 2025 and still there on 5.0.1.5 (amnezia-vpn/amnezia-client#1551). On macos hostnames from the list are never resolved, so nothing gets routed (amnezia-vpn/amnezia-client#3240).

sing-box could simply replace the official app for this, and I think it does this part better anyway:

  • routing is done by sing-box itself with rules (domains, rule-sets, process), not by pushing resolved IPs into the OS route table, which is exactly the part that breaks in the Amnezia client
  • one config works the same on every platform, instead of a separate split tunnel implementation for windows / linux / macos
  • matching is by domain at connection time, so no stale or missing IPs when a site changes addresses

The only missing piece is the protocol, there is no way to connect to a 3.1 server from sing-box. Right now the only option is forks, and afaik they are still on awg 2.0.

Can test builds against a 3.1 server if that helps.

Lingua principale
Go
Stelle
40.4k
Fork
5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SagerNet/sing-box

Tutte le issue di SagerNet/sing-box

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.