celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
2.61k stars 132 forks source link

Fallback VPN #1477

Closed aviv926 closed 2 weeks ago

aviv926 commented 1 month ago

Does Fallback for VPN exist? I find it super useful quite a few times the VPN profile I run starts to be slow because the server is busy, I would like to know if there is a possibility to perform load balancing or even fallback for VPN when one of them fails? I tried setting 2 different VPN configurations to be responsible for one app but it doesn't seem to perform the fallback like I thought it would.

Is there a plan for this?

Anyway, this is such a great app!!! Thank you for the development.

aviv926 commented 1 month ago

Can we let the user configure or automatically have the app detect when a VPN connection is busy and then switch the connection to a less busy VPN server? Maybe this is a good starting point from which we can return the load

https://api.protonmail.ch/vpn/logicals

ignoramous commented 1 month ago

Does Fallback for VPN exist

Not really, but Always-on WireGuard profiles (in Advanced mode) can serve a similar purpose.

switch the connection to a less busy VPN server

The client (in this case Rethink) can't really distinguish a "busy" server from a normal one. Rethink can however know when a server stops responding due to load. Though, I imagine doing an auto "load balancing" act among multiple WireGuard profiles will end up causing more confusion.

aviv926 commented 1 month ago

Does Fallback for VPN exist

Not really, but Always-on WireGuard profiles (in Advanced mode) can serve a similar purpose.

switch the connection to a less busy VPN server

The client (in this case Rethink) can't really distinguish a "busy" server from a normal one. Rethink can however know when a server stops responding due to load. Though, I imagine doing an auto "load balancing" act among multiple WireGuard profiles will end up causing more confusion.

thank you for the answer. When I do always-on it causes all applications to go through the VPN causing me to have trouble accessing certain services that don't allow the use of VPN. Can we enable always-on mode along with selected apps?

ignoramous commented 1 month ago

Can we enable always-on mode along with selected apps?

Yes, you'd have to individually turn ON Bypass app from all proxies per-app setting (from Configure -> Apps) available since v055l.

Maybe this is a good starting point from which we can return the load

This isn't a fit as the API is dependent on Proton, whereas Rethink is a generic client.

aviv926 commented 4 weeks ago

Can we enable always-on mode along with selected apps?

Yes, you'd have to individually turn ON Bypass app from all proxies per-app setting (from Configure -> Apps) available since v055l.

Maybe this is a good starting point from which we can return the load

This isn't a fit as the API is dependent on Proton, whereas Rethink is a generic client.

Yes, I just noticed that option, it's amazing, thanks!

Can we allow two vpn tunnels to include the same apps when always-on is enabled and then when one fails the other will take the routing to the selected apps rather than all apps?

ignoramous commented 4 weeks ago

then when one fails the other will take the routing to the selected apps rather than all apps?

well, it isn't a perfect solution but glad it works for your use-case (:

then when one fails the other will take the routing to the selected apps rather than all apps?

Always-on is meant to route ALL apps. If a (Advanced) WireGuard config should only route selected apps, then those apps must be added to that config. Unfortunately, as of today, Rethink doesn't support adding the same app to multiple (Advanced) WireGuard configs (which ties in to the original feature request to "load balance" among the active (Advanced) WireGuard configs).

ignoramous commented 2 weeks ago

We've implemented "load balancing" among Always-on WireGuards in v055n, and take some pains to choose the active ones (though, this may not work perfectly all the time). Please see if it works for you. Feel free to reopen this issues, if you face any issues.

aviv926 commented 2 weeks ago

We've implemented "load balancing" among Always-on WireGuards in v055n, and take some pains to choose the active ones (though, this may not work perfectly all the time). Please see if it works for you. Feel free to reopen this issues, if you face any issues.

Bro you guys are insanely fast! Thanks.

ignoramous commented 2 weeks ago

Does it work as expected? The load balancing is "sticky", as in if Chrome is first routed through a Always-on WireGuard (say, wg5), then it'll be continued to routed through wg5 until either wg5 stops working or if Rethink is restarted.