Skip to content

feat: add AmneziaWG protocol (hiddify-core awg endpoint) - #127

Open
DrvpnTM wants to merge 1 commit into
hiddify:devfrom
DrvpnTM:feat/amneziawg
Open

DrvpnTM wants to merge 1 commit into
hiddify:devfrom
DrvpnTM:feat/amneziawg

Conversation

@DrvpnTM

@DrvpnTM DrvpnTM commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

AmneziaWG (WireGuard with junk packets and changed headers, so DPI does not see it as WireGuard) as its own protocol next to WireGuard, served by hiddify-core 5.1+ as an "type": "awg" endpoint. Nothing else to install (the earlier awg-quick version is replaced).

What it does

  • Settings (category AmneziaWG): amneziawg_enable (off by default), amneziawg_port, the subnet (10.91.0.1 / fd42:42:91::1), the server key pair, and the obfuscation values jc, jmin, jmax, s1, s2, h1–h4. Migration _v190 generates valid random values (jmin < jmax, s1 + 56 != s2, distinct h values above 4) and syncs the presets.
  • Server: the AmneziaWG preset's hiddify-core config is the endpoint_other shell around hiddify-core/server/protocols/amneziawg: an awg endpoint on amneziawg_port with one peer per user (their WireGuard keys, an address in the AmneziaWG subnet). The peer's name is the user's uuid, so hiddify-core's per-user stats (metadata.User from the peer) count the traffic for usage and limits. It is skipped on hiddify-core < 5.1.0. The relay row reaches the same endpoint through the relay, so only the direct row serves it (one endpoint per port).
  • Clients:
    • the Hiddify app 5.1+ gets an awg endpoint in its subscription (hiddify-core/client/presets/amneziawg);
    • the AmneziaVPN / AmneziaWG apps get a .conf from /amneziawg (client core amneziawg, one file or a zip, like /wireguard), also listed on the user page;
    • no share link (none of the subscription apps reads one).
  • Public ports, translations (en, fa; the other languages partly English), admin UI labels.

Tested

py_compile; the server and client templates rendered with sample data: the server endpoint, the client endpoint with and without finalmask, and the skips (hiddify-core 5.0.3, Hiddify app 5.0.2, sing-box). Not run on a server.

Questions

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

🥷 Ninja i18n – 🛎️ Translations need to be updated

Project /project.inlang

lint rule new reports level link
Missing translation 5 warning contribute (via Fink 🐦)
Identical pattern 154 warning contribute (via Fink 🐦)

@hiddify-com

Copy link
Copy Markdown
Contributor

Thanks for your consideration

In the hiddify-core v5.1.0 we have included AWG 3.1
so it is preferable to use this core instead do you agree?

AmneziaWG (WireGuard with junk packets and changed headers, so DPI does
not see it as WireGuard) as its own protocol next to WireGuard, served by
hiddify-core 5.1+ as an "awg" endpoint: nothing else to install.

- settings: amneziawg_enable / port / subnet / server keys and the
  obfuscation values Jc, Jmin, Jmax, S1, S2, H1-H4 (migration _v190
  generates them; off by default)
- server: the AmneziaWG preset's hiddify-core config is an "awg" endpoint
  on amneziawg_port with one peer per user (their WireGuard keys, an
  address in the AmneziaWG subnet). The peer's name is the user's uuid,
  so hiddify-core's per-user stats count the traffic (usage, limits).
  Skipped on hiddify-core < 5.1.0. The relay row reaches the same
  endpoint, so only the direct row serves it.
- clients: the Hiddify app 5.1+ gets an "awg" endpoint in its
  subscription; the AmneziaVPN / AmneziaWG apps get a .conf from
  /amneziawg (client core "amneziawg")
- public ports, translations, admin UI labels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DrvpnTM

DrvpnTM commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

ok I send PR

@DrvpnTM DrvpnTM changed the title feat: add AmneziaWG protocol feat: add AmneziaWG protocol (hiddify-core awg endpoint) Oct 30, 2026
@DrvpnTM

DrvpnTM commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Agreed, thanks. I rewrote it on hiddify-core: AmneziaWG is now an awg endpoint of hiddify-core 5.1+, and the awg-quick service is gone (no PPA, no kernel module, works in Docker). Each user is a peer named by their uuid, so the usage is counted by hiddify-core's per-user stats like the other protocols. The Hiddify app 5.1+ also gets it in its subscription; the .conf download for the AmneziaVPN apps stays. The branch is rebased on the current dev (the conflict is gone).

One question: the client config is only given to the Hiddify app >= 5.1.0, assuming the app's version follows its hiddify-core version. Is that right, or is there a better check?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants