summaryrefslogtreecommitdiffhomepage
path: root/mullvad-management-interface/src
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2023-09-19 13:43:53 +0200
committerDavid Lönnhager <david.l@mullvad.net>2023-10-09 14:40:06 +0200
commitfc477f4e4df6db2973ff88fc4b6819d38d64d8cc (patch)
tree069b709abb09599b37f32716de679298095bc1c1 /mullvad-management-interface/src
parentbe5e93c32f3b3e9ec59da18215fad80457dd4d49 (diff)
downloadmullvadvpn-fc477f4e4df6db2973ff88fc4b6819d38d64d8cc.tar.xz
mullvadvpn-fc477f4e4df6db2973ff88fc4b6819d38d64d8cc.zip
Add `mullvad proxy use`
Allow for settings a specific Access Method to use
Diffstat (limited to 'mullvad-management-interface/src')
-rw-r--r--mullvad-management-interface/src/client.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/mullvad-management-interface/src/client.rs b/mullvad-management-interface/src/client.rs
index fb2eae28c3..900775b10a 100644
--- a/mullvad-management-interface/src/client.rs
+++ b/mullvad-management-interface/src/client.rs
@@ -513,6 +513,23 @@ impl MullvadProxyClient {
.map(drop)
}
+ /// Set the [`AccessMethod`] which [`ApiConnectionModeProvider`] should
+ /// pick.
+ ///
+ /// - `access_method`: If `Some(access_method)`, [`ApiConnectionModeProvider`] will skip
+ /// ahead and return `access_method` when asked for a new access method.
+ /// If `None`, [`ApiConnectionModeProvider`] will pick the next access
+ /// method "randomly"
+ ///
+ /// [`ApiConnectionModeProvider`]: mullvad_daemon::api::ApiConnectionModeProvider
+ pub async fn set_access_method(&mut self, access_method: AccessMethod) -> Result<()> {
+ self.0
+ .set_api_access_method(types::ApiAccessMethod::from(access_method))
+ .await
+ .map_err(Error::Rpc)
+ .map(drop)
+ }
+
#[cfg(target_os = "linux")]
pub async fn get_split_tunnel_processes(&mut self) -> Result<Vec<i32>> {
use futures::TryStreamExt;