Adding WSTunnel functionality to the project. - #1348
Conversation
|
Hello! Thanks a lot for this. I really appreciate the effort. I do want to support things like wstunnel, but I’d rather not bake these protocols directly into WG Tunnel. The goal is to keep the project focused on WireGuard and WireGuard derived protocols (like AmneziaWG). Instead of supporting other protocols directly, I’m planning to add upstream proxy support. This would let WG Tunnel proxy its WireGuard tunnels through other tools/protocols. Reasons for going this route:
Are you open to pivoting in that direction instead? I can add more details here on what this should look like if you’re interested in contributing to it. Otherwise we can close this PR. Thanks again! |
|
Hey, The only thing I want to flag before starting any development work on upstream proxy support is that given Wireguard is UDP, many upstream proxies won't support it. Either way, happy for this PR to be closed, and I'll continue to use my fork until I can build a separate app :) |
Summary
Adds optional support for bridging a tunnel's WireGuard traffic over WSTunnel (WebSocket transport), to help users get through networks/firewalls that block or throttle raw WireGuard UDP traffic while still allowing standard HTTPS/WebSocket traffic.
This is opt-in per tunnel and fully backward compatible. Tunnels that don't enable it behave exactly as before.
Motivation
Some networks (corporate firewalls, certain public WiFi, restrictive ISPs/countries) use Deep Packet Inspection to specifically identify and block WireGuard's UDP handshake pattern, even when the destination port is otherwise open. Wrapping the same traffic inside a WebSocket connection (which looks like ordinary HTTPS traffic) is a common, well-established way to route around this without needing a different VPN protocol entirely.
How it works
WireGuard itself is never made aware that WSTunnel is involved. When enabled:
127.0.0.1:<ephemeral-port>.This keeps the change entirely additive with no modifications to the WireGuard/AmneziaWG userspace (
libwg-go) implementation needed.What's included
:wstunnelGradle module bundling the official prebuiltwstunnelv10.6.1 client binary (BSD-3-Clause), verified against its published checksum.Known limitations
wstunneldoes not currently publish prebuilt Android binaries forarmeabi-v7a/x86/x86_64. The feature is hidden/disabled automatically on unsupported ABIs (this covers the large majority of current Android devices).Testing