Skip to content

WireGuard: Add AmneziaWG support with amneziawg-go v0.2.18#481

Open
merge-maestro wants to merge 1 commit into
partout-io:masterfrom
merge-maestro:feat/amneziawg-v2-support
Open

WireGuard: Add AmneziaWG support with amneziawg-go v0.2.18#481
merge-maestro wants to merge 1 commit into
partout-io:masterfrom
merge-maestro:feat/amneziawg-v2-support

Conversation

@merge-maestro

Copy link
Copy Markdown

Summary

Add AmneziaWG (AWG) protocol support to Partout by swapping the wireguard-go backend for amneziawg-go v0.2.18 and extending the data model, config parser, and UAPI generator.

Changes

Go Backend

  • Swap wireguard-go imports for amneziawg-go v0.2.18 in all Go source files
  • Update go.mod and go.sum with new dependency

Data Model

  • Add WireGuard.AmneziaParameters struct with all AWG obfuscation parameters:
    • Junk packets: jc, jmin, jmax
    • Packet junk sizes: s1, s2, s3, s4
    • Magic headers: h1, h2, h3, h4 (String type)
    • Special junk: i1-i5 (String type)
  • Extend LocalInterface with optional amneziaParameters field

Config Parser

  • Parse AWG parameters from .conf files ([Interface] section)
  • Emit AWG parameters when writing .conf files

UAPI Generator

  • Emit all AWG parameters (including s3/s4) in UAPI configuration sent to Go backend

Testing

  • Go module downloads and compiles successfully against v0.2.18
  • All existing device.Device, device.Logger, conn.PeekLookAtSocketFd APIs confirmed compatible

Notes

  • Companion PR for UI changes will be submitted to partout-io/passepartout
  • xcframework rebuild required for runtime changes to take effect

- Swap wireguard-go backend for amneziawg-go v0.2.18
- Add WireGuard.AmneziaParameters data model (jc, jmin, jmax, s1-s4, h1-h4, i1-i5)
- Extend LocalInterface with optional amneziaParameters field
- Update config parser to parse/emit AWG parameters from .conf files
- Update UAPI generator to emit all AWG parameters including s3/s4
- Update Go source imports from wireguard-go to amneziawg-go
@merge-maestro
merge-maestro force-pushed the feat/amneziawg-v2-support branch from cb9254c to 109e17b Compare June 16, 2026 23:41
@keeshux keeshux changed the title Add AmneziaWG support with amneziawg-go v0.2.18 WireGuard: Add AmneziaWG support with amneziawg-go v0.2.18 Jun 17, 2026
@keeshux keeshux added enhancement New feature or request WireGuard labels Jun 17, 2026
@keeshux

keeshux commented Jun 29, 2026

Copy link
Copy Markdown
Member

Hey, thanks for your contribution. The model part is on point, except that the library now defines all models in the OpenAPI schema, including Swift (but that is trivial to fix).

What I don't like about the AmneziaWG library fork is that I'd rather have it as an "extension" of the official WireGuard repository. You can look at go.sum and see how outdated it is compared to the fork base. But I'll think through that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request WireGuard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants