[GH-ISSUE #2988] Reverse-engineered vpn:// link format for AmneziaWG (undocumented) — happy to share/contribute docs #1366

Closed
opened 2026-10-13 20:41:04 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @mrskdsh on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/2988

Hi! I built a small self-hosted management panel for AmneziaWG servers
(since Marzban and similar tools don't support the AmneziaWG protocol),
and wanted the panel to generate proper vpn:// links so users could
add a server with one tap, showing a proper server name instead of
"Server 1".

The format doesn't seem to be documented anywhere, so I reverse-engineered
it — took a couple of attempts (partial reconstruction from OpenVPN-related
code fragments in this repo led to SSH auto-deploy errors, then instant
disconnects), until I decoded the actual vpn:// QR export from a working
connection to get the exact JSON schema.

Compression is qCompress (4-byte big-endian length prefix + zlib), then
base64url without padding — confirmed against the encoder in
amnezia-vpn/config-decoder. The JSON payload (sanitized example):

​json { "hostName": "your.server.ip", "description": "My Server", "dns1": "1.1.1.1", "dns2": "1.0.0.1", "defaultContainer": "amnezia-awg2", "containers": [{ "container": "amnezia-awg2", "awg": { "Jc": "6", "Jmin": "10", "Jmax": "50", "S1": "32", "S2": "49", "S3": "51", "S4": "6", "H1": "...", "H2": "...", "H3": "...", "H4": "...", "I1": "<r 2><b 0x...>", "I2": "", "I3": "", "I4": "", "I5": "", "port": "40824", "protocol_version": "2", "transport_proto": "udp", "last_config": "{...full nested client config as JSON string...}" } }] } ​

Full working implementation (Node.js) is here, if useful as reference:
https://github.com/mrskdsh/skdsh-panel/blob/main/src/awg.js
(see buildAmneziaVpnLink)

Not affiliated with the team, just sharing in case this saves someone
else the trial-and-error I went through. Happy to open a PR to
docs.amnezia.org if that's welcome, or if there's already internal docs
for this, feel free to point me there and I'll close this.

Originally created by @mrskdsh on GitHub (Aug 15, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/2988 Hi! I built a small self-hosted management panel for AmneziaWG servers (since Marzban and similar tools don't support the AmneziaWG protocol), and wanted the panel to generate proper `vpn://` links so users could add a server with one tap, showing a proper server name instead of "Server 1". The format doesn't seem to be documented anywhere, so I reverse-engineered it — took a couple of attempts (partial reconstruction from OpenVPN-related code fragments in this repo led to SSH auto-deploy errors, then instant disconnects), until I decoded the actual `vpn://` QR export from a working connection to get the exact JSON schema. Compression is `qCompress` (4-byte big-endian length prefix + zlib), then base64url without padding — confirmed against the encoder in amnezia-vpn/config-decoder. The JSON payload (sanitized example): ​```json { "hostName": "your.server.ip", "description": "My Server", "dns1": "1.1.1.1", "dns2": "1.0.0.1", "defaultContainer": "amnezia-awg2", "containers": [{ "container": "amnezia-awg2", "awg": { "Jc": "6", "Jmin": "10", "Jmax": "50", "S1": "32", "S2": "49", "S3": "51", "S4": "6", "H1": "...", "H2": "...", "H3": "...", "H4": "...", "I1": "<r 2><b 0x...>", "I2": "", "I3": "", "I4": "", "I5": "", "port": "40824", "protocol_version": "2", "transport_proto": "udp", "last_config": "{...full nested client config as JSON string...}" } }] } ​``` Full working implementation (Node.js) is here, if useful as reference: https://github.com/mrskdsh/skdsh-panel/blob/main/src/awg.js (see `buildAmneziaVpnLink`) Not affiliated with the team, just sharing in case this saves someone else the trial-and-error I went through. Happy to open a PR to docs.amnezia.org if that's welcome, or if there's already internal docs for this, feel free to point me there and I'll close this.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#1366
No description provided.