Skip to content

Latest commit

 

History

History
104 lines (75 loc) · 4.93 KB

File metadata and controls

104 lines (75 loc) · 4.93 KB

WireGuard Android with VK TURN Proxy

This is a specialized fork of the official WireGuard Android client with integrated support for VK TURN Proxy.

It allows WireGuard traffic to be encapsulated within DTLS/TURN streams using the VK Calls infrastructure, providing a robust way to bypass network restrictions while maintaining high performance and stability.

Important Disclaimer

This project is created solely for educational and research purposes.

Unauthorized use of the VK Calls infrastructure (TURN servers) without explicit permission from the rights holder may violate the Terms of Service and VK platform rules. The project author is not responsible for any damage or policy violations resulting from the use of this software. This project serves as a demonstration of protocol integration technical feasibility and is not intended for the misuse of third-party service resources.

Key Features

  • Native Integration: The TURN client is integrated directly into libwg-go.so for maximum performance and minimal battery impact.
  • VK Authentication: Automated retrieval of TURN credentials via VK Calls anonymous tokens.
  • Multi-Stream Load Balancing: High performance and reliability with parallel DTLS streams, Session ID aggregation, and round-robin outbound balancing.
  • MTU Optimization: Automatic MTU adjustment to 1280 when using TURN to ensure encapsulated packets fit standard network limits.
  • Auto-Reconnect on Network Change: Automatic TURN restart when switching between WiFi and 4G/5G with debounce protection.
  • Fast Network Recovery: DNS and HTTP connection reset on network change for quick reconnection.
  • Seamless Configuration: TURN settings are stored directly inside standard WireGuard .conf files as special metadata comments (#@wgt:).

Technical Credits

This project is built upon the foundations laid by:

  1. Official WireGuard Android — The core VPN application and user interface.
  2. vk-turn-proxy — The proxy server implementation (v2) required for this client.

Important: This client requires the server-side implementation from the kiper292/vk-turn-proxy fork to function correctly (Multi-stream Session ID support).

Building

# Requires Go 1.25+ and Android NDK 29
$ git clone --recurse-submodules https://github.com/your-repo/wireguard-turn-android
$ cd wireguard-turn-android
$ ./gradlew assembleRelease

Configuration

You can enable the proxy in the Tunnel Editor. The settings are appended to the Peer section of your configuration:

[Peer]
PublicKey = <key>
Endpoint = vpn.example.com:51820
AllowedIPs = 0.0.0.0/0

# [Peer] TURN extensions
#@wgt:EnableTURN = true
#@wgt:UseUDP = false
#@wgt:IPPort = 1.2.3.4:56000
#@wgt:VKLink = https://vk.com/call/join/...
#@wgt:StreamNum = 4
#@wgt:LocalPort = 9000

# Advanced settings (optional)
#@wgt:TurnIP = 155.212.199.166      # Override TURN server IP
#@wgt:TurnPort = 19302              # Override TURN server port
#@wgt:NoDTLS = false                # Disable DTLS (for direct WireGuard server access)

Note: NoDTLS = true mode is intended for debugging or direct connection to WireGuard server via TURN. It is incompatible with the proxy server which requires DTLS handshake.

For more technical details, see info/TURN_INTEGRATION_DETAILS.md.

Donations

Are welcome here:

bitcoin BTC:

1ERKmMSyfxtKNNpU3TeaYCaJfDKY9s8jdX

ethereum ETH Ethereum (ERC20):

0xfa8fdae60010e3d6b446d7479a9ccacfc56c0936

tether USDT TRON (TRC20):

TMgojRMiya1nJ2uEtw8u7p5YZ9J7Ykdmd9

tether USDT APTOS:

0x741a8b707b75aa57dc603fa30d1c4750198866b0e9eb6d9a7a1a7dde8ec7f4d2

tontoken TON / USDT TON:

UQD0BQTBSVo19hrjKyXnRc61MXW0j9dTZaLEXOUJwxLT2qRQ

litecoin LTC:

La2H1YD2zKxqhsziGrx74anjJYwAQJ67er

Contributing

For UI translations, please refer to the original WireGuard Crowdin. For technical bugs related to the TURN integration, please open an issue in this repository.