Skip to content

Add AmneziaWG protocol support#6

Merged
quyxishi merged 19 commits into
quyxishi:mainfrom
nsvk13:main
Dec 22, 2025
Merged

Add AmneziaWG protocol support#6
quyxishi merged 19 commits into
quyxishi:mainfrom
nsvk13:main

Conversation

@nsvk13

@nsvk13 nsvk13 commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

Implements support for AmneziaWG (obfuscated WireGuard) to enable VPN probing in censored regions where standard WireGuard is blocked.

Changes

  • Dependency: Use amnezia-vpn/amnezia-xray-core v1.8.16 (fork with AWG support)
  • Protocol scheme: Add awg:// URI scheme support
  • Parser: Implement AWG INI config parser with obfuscation parameters
  • Integration: Wire up AWG through xray-core's WireGuard protocol with obfuscation
  • Tests: Add TestParseURI_AmneziaWG with full parameter coverage
  • Example: Add AWG configuration to whitebox-sd-config.yml

Implementation Details

AWG uses the standard "wireguard" protocol in xray-core with additional obfuscation parameters:

  • Jc (0-128): Junk packet count
  • Jmin/Jmax (0-1280): Junk packet size range
  • S1/S2: Init/Response packet junk sizes
  • H1-H4: Magic headers for packet obfuscation

Testing

# Unit tests
go test ./internal/serial/... -v -run TestParseURI_AmneziaWG

# API test
curl "http://localhost:9116/probe?ctx=awg%3A%2F%2F<base64_config>&target=https://google.com"

@quyxishi quyxishi self-requested a review December 22, 2025 17:30
@quyxishi quyxishi merged commit 12c29c6 into quyxishi:main Dec 22, 2025
4 checks passed
@quyxishi quyxishi added the feature New feature or request label Dec 22, 2025
@quyxishi

Copy link
Copy Markdown
Owner

Thanks for the PR and the solid work on whitebox - appreciate that.

@nsvk13

nsvk13 commented Dec 22, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the PR and the solid work on whitebox - appreciate that.

Happy to help, and thank you for the project. I truly appreciate the opportunity

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

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants