schwabe / ics-openvpn

OpenVPN for Android
3.25k stars 1.18k forks source link

Ability to redriect traffic to server side proxy #1704

Closed scruel closed 3 months ago

scruel commented 3 months ago

We setup an OpenVPN server and a local proxy server on two machines in the same ethernetA, for our client devices which outer ethernetA, will need to connect to our OpenVPN server to get access to ethernetA, and want to have some apps' traffic goes to socks5 proxy server meanwhile: Client -> OpenVPN -> ethernetA -> other machines Client -> PAC rules umatched/selected apps -> Internet Client -> PAC rules matched/unselected & system apps -> OpenVPN -> ethernetA -> socks5 proxy (DNS resolve through proxy, IPv4 only) -> internet

Currently, with android global proxy settings, we will be able to redirect all traffic with HTTP proxy protocol, meanwhile all ethernet machines are still accessable: Client -> OpenVPN -> ethernetA -> other machines Client -> OpenVPN -> ethernetA -> HTT proxy -> internet

But as you can see above, we will route all traffic including unnecessary traffic into our server, which will slow the network and cause some issues, also, android only support HTTP proxy protocol on its own. Another solution is to unset global proxy, then set proxies inside the app itself, if its support to do so, however many apps won't provide built-in proxy support at all...

scruel commented 3 months ago

Or I don't know whether it will be possible to have an option which allows selected apps bypass the global HTTP proxy, this option should be enough for our scenario for now (if VPN stop routing checked apps, then they obviously won't be able to connect to the ethernet proxy which set globally on the device client side, e.g., 192.168.3.100:8080), though it would be better to have socks5 proxy supported. Thanks!

schwabe commented 3 months ago

I am afraid the flexibility you want in terms of HTTP proxy support is just not supported by Android itself, so the app cannot provide what you are looking for.