zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
918 stars 47 forks source link

[FEATURE] - Local HTTP/SOCKS5 proxy mode for use with other VPNs #87

Open Dondrejohnson5 opened 10 months ago

Dondrejohnson5 commented 10 months ago

Is your feature request related to a problem? Please describe. For quite a long time now I've always been torn between using the best ad blocker for Android, AdGuard, and using Cloudflare Warp via WireGuard for faster internet (no video buffering, less ping in video games, etc). I can't use both because Android only allows one VPN active at a time. AdGuard does have an automatic proxy mode for rooted devices to allow using WireGuard with it though, but ad filtering will not work if an ipv6 address is specified in the WireGuard config, which must result in me essentially connecting to ipv4 only, in order to continue experiencing the best of both AdGuard and Cloudflare Warp.

Describe the solution you'd like A mode in WG Tunnel that allows exposing configs to other compatible VPNs, like AdGuard, in a form of a local (127.0.0.1:xxxx) HTTP and/or SOCKS5 inbound proxy. In this manner, AdGuard, in it's regular VPN mode can filter ads in both ipv4 and ipv6 connections like normal, but through the proxy, so that I may also experience the benefits of Cloudflare Warp.

Describe alternatives you've considered

Additional context I recently found another GitHub project called Wireproxy. I haven't tried it, but, given the description of the project, it seems to present the solution related to my issue, it's just not made for Android. Hopefully it's content helps though.

zaneschepke commented 10 months ago

Thank you for all of these details and for creating an issue for this feature! I'll looking into this.

Rtizer-9 commented 10 months ago

@zaneschepke

I'm having the same issue along with many other people who want to use Adguard for adblocking with cloudflare warp for faster speeds.

Jabber-se commented 8 months ago

Probably one of the possible options, support for the cloak plugin, as was done in the shadowsocks client https://github.com/cbeuw/Cloak-android

zaneschepke commented 8 months ago

@Jabber-se I looked into the cloak plugin and it seems it is not compatible with wireguard.

I am having a hard time with Adguard's android app. It doesn't seem to request root even though I am on a rooted emulator.

@Dondrejohnson5 @Rtizer-9 Do either of you know how to get the Adguard android app to request root?

Rtizer-9 commented 4 months ago

@zaneschepke sorry for the late reply. I hope you've already figured it out. Anyway adguard is going to request root only when you use "automatic proxy" mode instead of VPN mode. In magisk it'll request but in ksu every root request needs to be manually granted.

Dondrejohnson5 commented 4 months ago

@Rtizer-9 last he and I spoke, he was testing all this on his own fork of the wg library. I don't remember what he said about it all going wrong, but for the sake of the stability of the app, he fell back to the official library. I'm not sure he's worked on this issue since

Rtizer-9 commented 4 months ago

Ok I understand. Singbox is also stable with adguard now and wireguard works perfectly there on alpha releases at least for me.

Dondrejohnson5 commented 3 months ago

The underlying IPv6 issue has finally been resolved on AdGuard's end, therefore mitigating the need for this request any further

onnyyonn commented 3 months ago

An HTTP/SOCKS proxy mode can be useful, beyond this specific use case with Adguard. I'd request to keep this issue open, if this feature is still in consideration.

cjmaxik commented 2 months ago

I am using AdGuard app in Local VPN mode (because no root), and using the Proxy feature to route traffic to Shadowsocks tunnel on demand. It is proven very useful, and I would still like to see this implemented for Wireguard/Amnezia.

Dondrejohnson5 commented 2 months ago

Reopened, as others would still like to see this feature come to fruition

bobpaul commented 3 weeks ago

For a WG client that exposes a socks5 proxy, I've successfully used zhsj/wghttp in Termux. wghttp is a command line app, but you can launch it from the home screen with a tool like Termux Widget. I have a pull request open for wghttp which adds AmneziaWG support.

One clever thing about wghttp is it uses the proxymux library from the tailscale project to simultaneously present both a SOCKS5 and HTTP proxy interface on a single TCP port.

Dondrejohnson5 commented 3 weeks ago

That is interesting, I will try it out. In the meantime, I have been experimenting with an Android app GUI called Oblivion, the only GUI that takes 1.1.1.1 app's source but seemingly uses WireGuard-go rather than Boringtun (could be wrong), but also adds a (work in progress) tun2socks interface to achieve a SOCK5 proxy, so it's something I hope for Zane to take inspiration from But in the meantime I'll see what wghttp do

Dondrejohnson5 commented 3 weeks ago

For a WG client that exposes a socks5 proxy, I've successfully used zhsj/wghttp in Termux. wghttp is a command line app, but you can launch it from the home screen with a tool like Termux Widget. I have a pull request open for wghttp which adds AmneziaWG support.

BTW if you can show me step by step how to achieve this in Termux, it'd be greatly appreciated

bobpaul commented 2 weeks ago

@Dondrejohnson5 how comfortable are you with the commandline on Linux?

SeanChengN commented 4 hours ago

I found this app today. I have been using Clash and AdGuard together. If this app can achieve this function, then I can abandon Clash and no longer need to make my server public.