emanuele-f / PCAPdroid

No-root network monitor, firewall and PCAP dumper for Android
https://emanuele-f.github.io/PCAPdroid
GNU General Public License v3.0
2.42k stars 285 forks source link

Connect to an Upstream VPN based on various factors #260

Open yoshimo opened 2 years ago

yoshimo commented 2 years ago

If you use pcap droid as your VPN app, you can't use other VPN apps to connect to connect home, work or a service provider that routes your traffic around the world. It would be good if you could add Upstream endpoints where you forward traffic to based on the WiFi network and type of connection available. When I am at home, I want the traffic to go directly over my WiFi network and use the local dns. Whenever I am using mobile networks I want to use a vpn connection to my home network for example. When I am at work, only traffic to specific internal hosts should be routed over the local WiFi, everything else but signal and WhatsApp Calls should be routed over my vpn to the home network.

emanuele-f commented 2 years ago

This is a quite advanced use case, which I'm not sure could be useful for many people. The first thing to do would be to make PCAPdroid compatible with other VPN apps. Normally such apps do not collaborate (e.g. don't have an API for this), so this would probably require integrating multiple VPN clients into PCAPdroid (e.g. Wireguard, OpenVPN, ...), which is already "big work". I'm not sure how many users will benefit from this. Also please note that there is a workaround to use PCAPdroid with other VPN apps, by using work profiles:

  1. Configure PCAPdroid to act as a SOCKS5 client towards Every Proxy
  2. Every Proxy receives connections from PCAPdroid, then proxies them to the Internet
  3. The connections then go into the VPN (due to the VPNService inside the work profile)
emanuele-f commented 2 years ago

Other ideas for integration: https://github.com/Gedsh/InviZible/wiki/Using-InviZible-alongside-with-VPN

emanuele-f commented 10 months ago

Ps. general VPNService integration discusson: https://github.com/emanuele-f/PCAPdroid/discussions/391 . Wireguard integration: https://github.com/emanuele-f/PCAPdroid/discussions/397