Skip to content

Commit 453abd0

Browse files
APPLE: add missing rpcClient split tunnel (#4769)
* APPLE: add missing rpcClient split tunnel * Patch rpc client for macos --------- Co-authored-by: Andrej Mihajlov <andrej@nymtech.net>
1 parent 9131fd7 commit 453abd0

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

  • nym-vpn-core/crates/nym-vpn-rpc-uniffi/src

nym-vpn-core/crates/nym-vpn-rpc-uniffi/src/lib.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use futures::StreamExt;
1111
use nym_vpn_proto::rpc_client::{Error as DaemonRpcError, RpcClient as DaemonRpcClient};
1212
use tokio_util::sync::CancellationToken;
1313

14+
#[cfg(target_os = "macos")]
15+
use nym_vpn_lib_types::SplitApp;
1416
use nym_vpn_lib_types::{
1517
AccountCommandError, AccountControllerState, EntryPoint, ExitPoint, FeatureFlags, Gateway,
1618
GatewayType, GetDeeplinkParams, HttpRpcSettings, LogPath, MixnetTrafficConfig,
@@ -379,6 +381,30 @@ impl RpcClient {
379381
}
380382
}
381383

384+
#[cfg(target_os = "macos")]
385+
#[uniffi::export(async_runtime = "tokio")]
386+
impl RpcClient {
387+
pub async fn set_enable_split_tunnel(&self, enable: bool) -> Result<()> {
388+
self.inner.clone().set_enable_split_tunnel(enable).await?;
389+
Ok(())
390+
}
391+
392+
pub async fn add_split_tunnel_app(&self, app: SplitApp) -> Result<()> {
393+
self.inner.clone().add_split_tunnel_app(app).await?;
394+
Ok(())
395+
}
396+
397+
pub async fn remove_split_tunnel_app(&self, app: SplitApp) -> Result<()> {
398+
self.inner.clone().remove_split_tunnel_app(app).await?;
399+
Ok(())
400+
}
401+
402+
pub async fn clear_split_tunnel_apps(&self) -> Result<()> {
403+
self.inner.clone().clear_split_tunnel_apps().await?;
404+
Ok(())
405+
}
406+
}
407+
382408
#[derive(Debug)]
383409
pub enum InnerRpcError {
384410
RpcError(DaemonRpcError),

0 commit comments

Comments
 (0)